On Fri, 8 Sep 2000, Chuck Goehring wrote:

> Hi,
> 
> Having a big problem here.
> 
> When I use an eval{} block to trap dbi errors, it doesn't seam to work as
> documented under mod_perl.
> When I found this problem, I created a test program that connects, prepares
> and executes a bogus sql
> statement.  The $lsth->execute() || die $DBI::errstr; is triggering the
> default "Software Error" message
> and the cgi ends.  Toggling RaiseError changes the wording of the error
> message but does not affect the
> error trapping.  Under mod_perl, the die() within the eval block causes the
> program to really die
> even with RaiseError => 1.  I thought I had this all nailed down but now I
> get un-gracefull error
> handling in my web app.  The command line version works correctly.  Both
> test programs and the
> version info are listed below.
> 
> Deploying two major systems & need some help.  Any suggestions?

CGI::Carp is _not_ for people who want to be able to do exception handling
- it implements its very own system wide (and IMHO broken) exception
handler, which prevents eval {} from working properly.

Get rid of it.

(if you understand all the details, add in a "local $SIG{__DIE__};" to the
eval block, but thats not a scaleable solution).

-- 
<Matt/>

Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org | AxKit: http://axkit.org


Reply via email to