in reply to Error handling - how much/where/how?
It's an option to use a common use error handling library. As sometimes giving the error on the return of the sub is not a good option (for example a sub that can return any value).
I use the Error library. It implements the try/catch syntax, enables printing the stack trace (as someone suggested on this thread) and doesn't require other things from people who use your module, since the exception is a regular die (with some info saved inside Error).
I like this approuch because it's easier to handle errors from methods that can throw many types of exceptions, you can programatically do something when *this* error and otherthing when *that* error very easy.
daniel
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Error handling - how much/where/how?
by xdg (Monsignor) on Jun 13, 2005 at 13:40 UTC | |
by ruoso (Curate) on Jun 13, 2005 at 16:23 UTC |
In Section
Seekers of Perl Wisdom