in reply to Exception handling (alternatives)
i'm happy to see anyone working on this kind of stuff. i've played around with the exception handling modules on CPAN and recently ended up writing my own which is very similar to what you have but is more focused on being a layered error handling system similar to what is found in large dbms's. (not clean enough to show off yet though)
i'm not really sure that this or any of the ones in CPAN really offer anything more than syntactic sugar over the regular eval/die technique. what i'd really like to see is a pragma or something that gives us the real powerful part of java's exception handling: compile-time checking. for those who aren't familiar with how it works in java, if any code in the try block can possibly throw an exception, the compiler forces you to put an appropriate catch() in place. it gets to be a pain sometimes when you use a class method that potentially throws lots of exceptions because you have to explicitly catch them all, but it does a good job of keeping runtime errors out of your program.
|
|---|