Keep It Simple, Stupid | |
PerlMonks |
Re: How do I report an error back to the user of my object?by bobf (Monsignor) |
on Jun 06, 2012 at 15:18 UTC ( [id://974747]=note: print w/replies, xml ) | Need Help?? |
Interesting thread. Thanks for launching it. I wrestled with this recently and, while I know a lot of monks more experienced than me would recommend just die-ing on error, I decided to use a softer approach. I created a few error-handling methods for my class that can be called as follows:
The main reasons I went with this approach are:
I realize this may be a choice that goes against accepted conventions, and over time (as my modules mature and become more battle-tested) I may change the way errors are handled. For now, though, this approach works well.
In Section
Seekers of Perl Wisdom
|
|