[boulder.pm] error handling

Walter Pienciak walter at frii.com
Mon Feb 4 11:13:45 CST 2002


On Fri, 1 Feb 2002, Rob Nagler wrote:

> > But times have changed, a lot, and I am wondering lazily what
> > mechanisms people use for this kind of error handling, and how
> > they like it.
>
> I like calling die when a problem occurs.  I also like having a
> wrapper which at some contextual information to the internal logs.
>
> We have a few problems which result in an email being sent to root.
> For the most part, we rely on high frequency log parsing.  We have a
> multitiered alert system, which is controlled by regular expressions
> and counters in the log parser.  For example, if we get three die
> calls of a specific type, we send a page.  Otherwise, we send email.
>
> Rob

Huh.  I don't call die, but rather the exeunt() function does an
'exit 0' when it's done all the notifying I want it to.  I hope that
was "obvious" to everyone following along.

Here're the thoughts I have on this (and I'm wondering if we're
talking about the same things and each leaving out the "obvious"
stuff):

I like sending the browser a nice, bland "there's a problem and
we're working on it" message rather than letting them see a
'500 Internal Server Error' message or the results of a die, which
might contain system info they have no need to see.  (That's a security
issue at least as much as an aesthetic one.)

When my stuff explodes, I want to know about it.  Then again, most
of our web programming is straightforward, and if it wants to die,
something is WRONG.  I'm not sure I understand the value of setting
a die-notification threshold to anything but 1.

Also, I must confess, I was hoping some folks would chime in with
their favorite error-handling tools.  There's a whole range of
stuff from '500 Internal Server Error' to 'use CGI::Carp qw(fatalsToBrowser)'
and redirecting STDERR through custom jobbies (again ranging from simple
things like exeunt through elaborate work -- such as Bivio/BoP stuff?)

There are SO many tools out there, and we don't all have the time
to check out each one of them, regardless of good intentions.

Walter




More information about the Boulder-pm mailing list