Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by LanX (Sage)
on Jul 06, 2019 at 12:53 UTC ( #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? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2022-01-19 15:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (55 votes). Check out past polls.

    Notices?