Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Error handling

by GrandFather (Cardinal)
on Sep 17, 2012 at 22:14 UTC ( #994130=note: print w/ replies, xml ) Need Help??


in reply to Error handling

If your error messages are as shown keep them to a minimum. They don't help the maintainer because they don't describe the details of the problem and they don't help the user because they don't describe how to avoid the problem.

Decide who the error messages are for and make sure they provide the best possible information for the audience. For a user that means describing the nature of the problem and how to fix it. For a maintainer that means describing as much of the pertinent context as possible so further debugging sessions are less likely to be needed to diagnose the problem.

User error messages are likely to be confined to areas of the code validating input. Maintenance error messages are likely to be sprinkled through the rest of the code as a sanity check and in place of a comment describing the expected outcome of steps. A test and die that checks an outcome is both documentation and sanity checking.

True laziness is hard work


Comment on Re: Error handling

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2014-11-27 21:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (188 votes), past polls