in reply to Capturing error thrown by a database

Take a look at DBI and it's error-related attributes.
use DBI ; my $dbh = DBI->connect($data_source, $username, $auth); $dbh->{PrintError} = 1 ; $dbh->{RaiseError} = 1 ;

Replies are listed 'Best First'.
Re^2: Capturing error thrown by a database
by puneet.keswani (Novice) on Aug 01, 2011 at 07:56 UTC
    I have used the attributes but without much luck.. while trying to connect to database, I have also tried wrapping the code within eval but again its not helping. If you want I can paste the code..
      Posting your code would help. You can define a subroutine to handle all of your DBI errors: HandleError.
        I'll also point out the DBD::Sybase implements its own error handler callback (syb_err_handler connection level attribute). See the DBD::Sybase docs for details.

        Michael