Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Re: How do I get errors printing out to the browser?

by jsprat (Curate)
on Aug 05, 2003 at 16:43 UTC ( [id://281066]=note: print w/replies, xml ) Need Help??


in reply to Re: How do I get errors printing out to the browser?
in thread How do I get errors printing out to the browser?

if a Perl script fails perl -c then the server is only going to issue an internal error to your browser.
Why do you say that? fatalsToBrowser will report errors to the browser whether the script compiles or not. It even reports line numbers and paths, which is a good reason to remove fatalsToBrowser in production code.

Replies are listed 'Best First'.
Re: Re: Re: How do I get errors printing out to the browser?
by sgifford (Prior) on Aug 05, 2003 at 16:57 UTC

    Just to verify what jsprat is saying:

    #!/usr/bin/perl -w use CGI ':standard'; use CGI::Carp qw(fatalsToBrowser); $i = 6; || $j = 7;
    produces:
    Content-type: text/html <H1>Software error:</H1> <PRE>syntax error at /tmp/t63 line 6, near &quot;; ||&quot; Execution of /tmp/t63 aborted due to compilation errors. </PRE> <P> For help, please send mail to this site's webmaster, giving this error + message and the time and date of the error. [Tue Aug 5 12:58:07 2003] t63: syntax error at /tmp/t63 line 6, near +"; ||" [Tue Aug 5 12:58:07 2003] t63: Execution of /tmp/t63 aborted due to c +ompilation errors.

    chriso: Do you see the same problems with this simple script, or does it display the error in the browser as you expect?

Re: Re: Re: How do I get errors printing out to the browser?
by blue_cowdawg (Monsignor) on Aug 05, 2003 at 17:08 UTC

    OK.... maybe it is a case of YMMV and depends on the server and its configuration. I was able to verify what you are saying as true on my test apache server at home.

    However, in my professional experience what I said in my reply is also true with a lot of servers and server configurations.


    Peter @ Berghold . Net

    Sieze the cow! Bite the day!

    Test the code? We don't need to test no stinkin' code! All code posted here is as is where is unless otherwise stated.

    Brewer of Belgian style Ales

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-23 14:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found