Siegfried Heintze wrote:

How do I throw an exception when my database API reports an error code? The
database implementation does not throw exceptions so I have to.

use the die() function... perldoc -f die

$dbh->whatever($query) or die $dbh->errstr;

Your specific API would have more info on specifically how to do it for that.

You may also be able to use the Raise_Error (or something like that) option when creating a new $dbh onject.

without more specific info about the how the dbh is created or used its difficult to be precise.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to