[Maypole] catching DB errors

Peter Speltz peterspeltz@yahoo.com
Tue, 25 Jan 2005 08:25:04 -0800 (PST)


--- Toby Corkindale <maypole@wintrmute.net> wrote:

> On Mon, Jan 24, 2005 at 01:48:01PM -0500, Dana Hudes wrote:
> > On Mon, 24 Jan 2005, Toby Corkindale wrote:
> > > Hi,
> > > The DB errors currently go to the apache error_log, and the user sees a
> 404
> > > Page not found error.
> > > 
> > > It'd be nice to present a page saying "Sorry you hit an error:" and then
> > > displays the error message, at least, for our testing purposes.
> > > 
> > > What would be the best way to go about this in Maypole?
> > 
> > not the most user-friendly but have you tried CGI::Carp with the 
> > fatalstoBrowser option...at least your
> > error message will be shown to the user instead of a generic error page
> > (which s/b 500 server internal error not 404 page not found)
> 
> Thanks Dana,
> 
> I'd thought about using a similar catch-all-fatals system, but I think
> Maypole
> already tends to catch most exceptions itself - which is probably why we get
> a
> 404 error instead of a 500 as expected.
> 
> I was thinking it would be nice if we could catch certain errors and then
> stick within the Maypole framework for display/handling - eg. a
> model-specific
> error handler routine, call-outs to the 'error' template, etc.
> 

> I'll keep looking into it; hints welcomed :)
> 

Have you read teh Maypole::Manual::Request error handling section?  I follow
that model, then when i come to an error just do a "return $r->error("Error.
we're dead")"  .

=====
pjs

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com