[Maypole] catching DB errors

Dave Howorth dhoworth@mrc-lmb.cam.ac.uk
Wed, 26 Jan 2005 13:02:05 +0000


Toby Corkindale wrote:
> However, I've tried putting an error subroutine into both the main driver
> class, and also the model classes too.
> In neither case was it actually called when the DB threw up an error.
> 
> Is the error sub supposed to be called in these cases, or am I misinterpreting
> what it was designed for?

It doesn't get called. You have to call it when you think it is 
appropriate, as described in the manual:

   Now in your actions you can say things like this:

     if (1 == 0) { return $r->error("Sky fell!") }

Cheers, Dave