i agree with this goal, so now i am mostly interested in figuring out how to get there without creating to much hassle for anyone.
i am not sure if it is possible to come up with proper error types for all errors in one batch. more likely this is done one error at a time. whenever someone comes across an errortype in their code.
i'd be happy to create new error types for the errors that my code is currently handling.
batch converting to Error.Generic would only be a sideffect from changing the error() function in the master.
if the goal of making proper types is followed through then this error() function could eventually be removed completely, so potentially use of it could be discouraged by some means.
the reason for changing error() to return an error object is to be sure that any error handling code can be sure to only have error objects to deal with. this may not be necessary if there is a simple way to test the error type that works with arrays too.
hmm, (object_program(error)==MySpecialError) appears to work and not complain if the error is an array.
i suppose there is no solution to make catching error easier and we still need to do:
mixed error = catch { ... }; if (object_program(error)==MySpecialError) //handle the error else throw(error);
catch(MySpecialError){ ... }; would be nice.
greetings, martin.