On Wed, Oct 01, 2003 at 12:25:02AM +0200, Martin Nilsson (saturator) @ Pike (-) developers forum wrote:
Looking through the functions in the System module it looks like a big mix between throwing an exception on error or returning the errno from the function.
In cases if we would have an exception model like in Java/C++ (where type of exception may be checked easily - say, catch only file system errors, etc) - it would make sense to use an exceptions.
But in current state, when exception returns human readable message, it makes a bit difficult task to identify the nature of exception.
Sure, in some cases exceptions would be logical ("file system is full"), but sometimes this is a bit too much, IMHO.
The ideal solution is to make it configurable - with #pragma or whatever, which model to use. Regular #defines wouldn work well in case of precompiled modules (since those will use symbols known during installation time only).
Regards, /Al