|
|
| Syntactic Confectionery Delight | |
| PerlMonks |
Re: Learning how to use the Error module by exampleby dragonchild (Archbishop) |
| on Jul 29, 2003 at 08:29 UTC ( [id://278800]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
I use Error in my personal scripty-doos at work (it's actually a bunch of modules for my personal consumption) and it works really well. You have to create a bunch of Error classes that will describe the type of error you are trapping on. This is because Error deals with the class of the error and makes decisions based on that.
Here's what I do with DBI (for instance}: Note that I have wrapped around DBI->connect and IO::File->new, in order to provide consistent error handling. ------ Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement. Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||