massaging error messages
- From: oudeis@xxxxxxxxxxxxxxxx (Will Parsons)
- Date: Sat, 24 Feb 2007 21:20:35 +0000 (UTC)
I'm trying to change the text of error messages, for example the following:
DBD::SQLite::db do failed: table X already exists(1) at dbdimp.c line 269
From the user's point of view, "table X already exists" is valuableinformation, but "at dbdimp.c line 269" is useless.
I've attempted to do this using the HandleError attribute with a function:
sub handle_error {
$_[0] =~ s/ at dbdimp.c line \d+//;
print STDERR "db error: $_[0]\n"; # for debug
return 0;
}
The print statement shows the handler is changing the error text, but
the contents of $DBI:errstr on return from an offending statement show
the original text.
How can I do this?
- Will
.
- Follow-Ups:
- Re: massaging error messages
- From: Tim Bunce
- Re: massaging error messages
- Prev by Date: ANNOUNCE: DBI 1.54
- Next by Date: Re: massaging error messages
- Previous by thread: ANNOUNCE: DBI 1.54
- Next by thread: Re: massaging error messages
- Index(es):
Relevant Pages
|