Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

comment on

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

In an attempt to get to the bottom of this I have moved away from CGI::Carp qw(fatalsToBrowser) and instead I have tried using CGI::Carp qw(carpout) * by putting this in my BEGIN block.

BEGIN { use CGI::Carp qw(carpout); if ($RealBin =~ m!^(/home/xxx/yyy/(test|uk)/www)!) { $safepath = "$1/../lib"; } else { die "Illegal use of software - visit www.way-finder.uk to use +this site"; } open LOG, '>>', '/home/xxx/yyy/test_error_log.log' or die "Unable +to open error log"; carpout(\*LOG); }

I've tested it on our test site which doesn't give the 500 errors. The script returns the HTML as expected and writes a few lines about uninitialised stings to test_error_log.log. I've then added a die statement in the code and tested again - and again it writes that to the log file as expected.

This version of the script has been migrated to the production environment and, as expected, the same warnings get written to the log file. But, when the 500 error happens nothing gets written to the log file. So I've deleted the log file and refreshed the page and kept repeating until I get the error. The logfile is created but nothing is written to it.

What could cause the BEGIN block to execute but not the rest of the script without carpout writing anything at all to the log file???

* CGI::Carp qw(carpout) seems to be the fatalsToFile I was looking for in CGI::Carp fatalsToFile


In reply to Re: Errors uncaught by CGI::Carp by Bod
in thread Errors uncaught by CGI::Carp by Bod

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: (4)
As of 2024-04-23 06:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found