XP is just a number | |
PerlMonks |
Re: Re: Re: The art of error handlingby jreades (Friar) |
on Dec 20, 2000 at 00:55 UTC ( [id://47460]=note: print w/replies, xml ) | Need Help?? |
The system I have tried to use across the Web site I control, and which I have found particularly useful for DBI work, is:
Each subroutine returns either
or
You can pepper these throughout your code anywhere there's a DBI action able to fail and it ensures that you can fail somewhat gracefully. It's not perfect, but it also makes error-checking easy (just test whether $errors contains anything) and allows you to develop a cascading series of calls where it doesn't bother executing subsequent queries if one has already failed.
In Section
Seekers of Perl Wisdom
|
|