Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Error Output

by geckosan (Sexton)
on Jan 21, 2009 at 20:40 UTC ( [id://737942]=perlquestion: print w/replies, xml ) Need Help??

geckosan has asked for the wisdom of the Perl Monks concerning the following question:

Struggling with this one.. How on earth can I combine CGI::Carp qw(fatalstobrowser cluck set_message etc.) and like maybe $SIG{ __DIE__ } and such to have fatal errors caught and printed to the browser window WITH a complete stack trace?

Replies are listed 'Best First'.
Re: Error Output
by kennethk (Abbot) on Jan 21, 2009 at 20:56 UTC
    You can generate a fatal error with full stack trace with confess, and then have that message sent to browser using CGI::Carp qw(fatalstobrowser). It's all in CGI::Carp.
      ah you pointed me in the right direction. $SIG{ __DIE__ } = sub { confess( @_ ) }; with fatalstobrowser did the trick, thanks mighty monks. for some reason that particular combination was eluding me. o_o
      I'm not generating the error, it's coming up in the code.
        If your code is calling die, then $SIG{__DIE__}=\&{cluck @_}; along with CGI::Carp qw(fatalstobrowser) should do you.
Re: Error Output
by leocharre (Priest) on Jan 21, 2009 at 20:55 UTC

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (2)
As of 2026-03-11 15:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.