RE: Documentation / Error checking
- From: calius@xxxxxxxxxxxxxxxx (Nitzan Shaked)
- Date: Fri, 18 Nov 2005 15:49:21 +0200
Thanks Tim.
> I'll clarify the docs. Basically all methods calls reset err except for
> just a few special cases such as err and errstr, obviously, and FETCH
> eg $foo = $h->{SomeAttribute}).
>From the first part of your answer I understand that's it's always okay to
test for "defined DBI::err" (if I want to die on warnings) or "DBI::err" if
I am willing to live with warnings and would like to die on errors only. Is
that correct?
> Well, if you're going to die() I'd just set RaiseError and forget about
it.
> If there's some good reason you don't want to use RaiseError then this
would do:
Of course when I write "die" I don't really mean die, I have error handling
code which does quite a bit. It's just a shorthand for writing. Otherwise I
would use RaiseError as you suggest.
> my $hr = $dbh->selectrow_hashref( ... ) or die(...);
.... but from your first part of your answer I may also do:
my $hr = $dbh->selectrow_hashref( ... );
defined $DBI::err and do_special_error_handling_code();
.... correct?
Thanks again,
Nitzan
.
- Follow-Ups:
- Re: Documentation / Error checking
- From: Tim Bunce
- Re: Documentation / Error checking
- References:
- Re: Documentation / Error checking
- From: Tim Bunce
- Re: Documentation / Error checking
- Prev by Date: Re: Documentation / Error checking
- Next by Date: Re: anyway to determine # rows before fetch loop ends and without seperate count(*)
- Previous by thread: Re: Documentation / Error checking
- Next by thread: Re: Documentation / Error checking
- Index(es):
Relevant Pages
|