in reply to Re: how do i get the database error from this code
in thread how do i get the database error from this code

Yes i've read all of the DBI page but i'm a perl beginner and don't really know how to use the eval structure. I've read about setting RaiseError = 1/0. I want to use the automatic error handling from setting raise error = 1. However i don't know how to 'catch' the die in an eval loop so I can customise the error message for the end user . Will the error message raised by the dbi simply be in the $@ variable so I can work with that?
  • Comment on Re^2: how do i get the database error from this code

Replies are listed 'Best First'.
Re^3: how do i get the database error from this code
by ikegami (Patriarch) on Jan 04, 2011 at 17:21 UTC

    Will the error message raised by the dbi simply be in the $@ variable so I can work with that?

    Yes. $dbh->err and the like should also be populated.