in reply to Re: Re: Error Handling in Object-Oriented Perl
in thread Error Handling in Object-Oriented Perl
I don't know about best practices, but I do this all the time...
eval { ... } if( my $err = $@ ) { die $err; }
However, I tend to make my code propagate most of fatal errors all the way up to the user, unless there is some compelling reason that the error must be trapped in that particular level. I trap and re-throw in mostly in cases when I want to add more logging information than $@ would otherwise contain... otherwise I just let it propagate.
... and since that "compelling reason" varies from application to application, I don't have a general solution :(
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Error Handling in Object-Oriented Perl
by Joost (Canon) on May 24, 2002 at 16:09 UTC | |
by lestrrat (Deacon) on May 24, 2002 at 17:30 UTC |