Programmer's notebook: a taxonomy of error handling

From: Irving Kimura (irving_kimura_at_lycos.com)
Date: 01/30/04


Date: Fri, 30 Jan 2004 02:55:29 +0000 (UTC)


(Note to the impatient: The connection with Perl doesn't emerge
until the end of this post.)

I find that nothing complicates and obfuscates my code more than
the problem of dealing with errors: user errors, system errors,
algorithm-design errors...

Just checking for the occurrence of errors and doing something dumb
like aborting the program is bad enough, but trying to make my code
fault-tolerant and/or make it generate reasonably helpful error
messages, turns my code into a horror show. (If on top of this I
add CGI as the context, I begin to contemplate seppuku as the only
way to avoid disgrace.)

The truth of the matter is that I have yet to find a good way to
architect my error handling. Granted, there are many types/levels
of error (as mentioned above) and handling each of these may require
an entirely different architecture. It doesn't matter: I haven't
hit upon a good formula for any of them.

Now I'm at the stage of learning good Perl programming, which
includes reading good Perl source, so I would like to study examples
of Perl modules (from CPAN) with well-designed error-handling
schemes.

Any recommendations would be greatly appreciated.

Irv



Relevant Pages

  • Re: Adding a delimiter inbetween number characters and letter characters
    ... necessary minimum) quotes of the relevant material you're replying ... COMPLEX regexen tend to become confusing, ... IF RTM is a matter of a few lines that first or later you ... Perl, that is... ...
    (comp.lang.perl.misc)
  • Re: strange, please explain
    ... Do NOT use 'chop'. ... It probably doesn't matter with this particular file that you happen ... Every Perl text book explains that. ... Your code writing style is quite clean if you are a beginner. ...
    (perl.beginners)
  • Re: perl OOP
    ... It's not a matter of belief. ... How is someone less familiar with Perl to ... What benefit do you see in misleading him with incorrect ... Web Hosting by West Virginians, ...
    (comp.lang.perl.misc)
  • Re: Server-side script executed on page load or event, but not SSI
    ... Henry wrote: ... it really doesn't much matter what the raw material is. ... You can use Perl for the task you're suggesting. ... have a CGI script display the pages)? ...
    (comp.lang.perl.misc)
  • Re: Adding a delimiter inbetween number characters and letter characters
    ... No matter what obscenities you ... they say "read the manual" in practice that is basically dismissing the ... anyone who has asked a question and gotten "Pssh, thats easy read the ... everything about Perl. ...
    (comp.lang.perl.misc)