Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: comprehensive error handling

by mgibian (Acolyte)
on Jul 16, 2003 at 21:55 UTC ( #275048=note: print w/replies, xml ) Need Help??


in reply to comprehensive error handling

Thank you everyone for your answers... they have been very helpful. I have already tried creating a method checkError and using the form:
open(...) or $self->checkError(-1, "message with $!");
I am using the method so that checkError has access to all of the methods for the class in its processing. This is a composite of a few of your suggestions and right now is addressing my current needs. For the long term, there is an attractiveness for using exceptions, though I am concerned by some of the comments I've read regarding limitations in the Perl exception mechanism.

Replies are listed 'Best First'.
Re^2: comprehensive error handling
by adrianh (Chancellor) on Jul 18, 2003 at 10:36 UTC
    For the long term, there is an attractiveness for using exceptions, though I am concerned by some of the comments I've read regarding limitations in the Perl exception mechanism

    The only problem I've come across is the lack of direct syntax support. Once you get over seeing eval, die and if ($@) instead of try, throw and catch there shouldn't be any problems.

    But then, as you've probably guessed, I have a bias towards exception handling as a "good thing" :-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://275048]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2020-12-04 15:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (60 votes). Check out past polls.

    Notices?