... or simply surround the DBI calls with eval()..
my $dbh; eval { ## bunch of dbi calls.. $dbh = DBI->connect( ... ); $dbh->do( blah ); $dbh->commit; $dbh->disconnect; }; if( my $err = $@ ) { eval{ $dbh->rollback }; eval{ $dbh->disconnect }; ## print header, html, and $err exit 1; # or return, whatever }
In reply to Re: Re: Printing DBI errors from a CGI script
by lestrrat
in thread Printing DBI errors from a CGI script
by PB
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |