------------------------------------------------
On Wed, 17 Sep 2003 09:48:31 +0200, peter grotz <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> I wanna use a mysql-database for our systemuser-management.
> Adding and showing a list of users is no problem but now my question:
> 
> How can I handle the appearing mysql-errorcode instead of the 
> "die"-statement when I´m selecting or deleting a nonexisting entry in my 
> database?
> 

You may want to have a look at the documentation for 'RaiseError' and 'PrintError' in 
the error handling section of the DBI docs:

http://search.cpan.org/author/TIMB/DBI-1.38/DBI.pm#PrintError

In general, for a web app (which you didn't indicate you had) I prefer not raising an 
error (default) and switching 'PrintError' off. Then performing my own error handling 
with 'errstr' attribute.  Otherwise I would probably let RaiseError handle them and 
catch the exception (if I needed to) with an 'eval if ($@)' construct.

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to