Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Error codes vs die exceptions vs ...

by LanX (Saint)
on Jul 06, 2019 at 12:53 UTC ( [id://11102475]=note: print w/replies, xml ) Need Help??


in reply to Re: Error codes vs die exceptions vs ...
in thread Error codes vs die exceptions vs ...

> What information do you need to pass so that someone (not necessarily the direct caller) can fix the error?

Thanks for nailing it.

In the demonstrated case the direct caller must react and the details of the error are only relevant for STDERR.

And it doesn't stop me catching fatals on a higher call level with try/catch.

> only in the (exotic, IMHO) case where every value, including undef, is a valid return value.

Please note that that's not a problem in the demonstrated model with list assignments.

One can safely return undef.

I.e. only an empty return counts as error.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

  • Comment on Re^2: Error codes vs die exceptions vs ...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-25 16:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found