Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Odds are, if you pass errors from modules you didn't write, you're leaking information to the user that they either won't understand, or they will understand, and can potentially use to exploit the system.

I'd recommend trapping all errors, and sending them to the error log, but sending a generic message to the user. (hopefully something more than 'something went wrong ... contact the system administrator'). You might trap and leave a different generic message in different sections of your code.

Depending on what the site's doing (and how locked down it is in the first place), I might hide a more useful error code/message in the source, but typically, the error page is a feedback form to alert the sysadmin -- they can leave contact information if they wish, but I can also poll for HTTP_USER_AGENT and the like, and ask them what they were doing at the time it gave them problems.

And I think it goes without saying -- if you're likely to error out due to database connections, don't track this in the database, and if you're likely to error out from writing files, don't write it to a log file w/out some other form of backup. Mail is usually good, so long as the partition w/ the mqueue doesn't fill up. (and you watch it to make sure mail's actually flowing)


In reply to Re^4: error messages without program names or line numbers by jhourcle
in thread error messages without program names or line numbers by EvanK

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2024-04-18 15:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found