On Fri, May 09, 2008 at 02:25:03PM +0200, Johan Sundstr�m (Achtung Liebe!) @ Pike (-) developers forum wrote:
Error e = Error.inspect(catch(...)); // returns falsity for catch()=>0
in 7.7 there is already an Error.mkerror() function which does pretty much just that.
it was added after i stumbled over the same problem of wanting to avoid having to write complex checks for a catch result.
it currently only detects e->is_generic_error, and wraps everything else into an Error.Generic which could probably benefit from some improvement in case there are Error classes that don't inherit Error.Generic (although having one base class for all errors makes things easier)
greetings, martin.