in reply to Re: Trapping CGI Error
in thread Trapping CGI Error

From my understanding of CGI::Carp 'fatalsToBrowser', it outputs fatal errors to the browser. I've never used it, so I could be wrong. I don't want to out put them, I just want to trap them.

Instead of the browser displaying
CGI Error Your cgi script misbehaved by not returning...
I want to be able to trap that error, possibly write it to a log file, and display a nicer looking page that says something like

We are currently experiencing technical difficulties please try again +later.

Replies are listed 'Best First'.
Re: Re: Re: Trapping CGI Error
by jasonk (Parson) on Mar 19, 2003 at 19:40 UTC

    You can assign subroutines to $SIG{__WARN__} and $SIG{__DIE__} that will get called in case of warnings or dying, and do any logging you want there. See 'perldoc -f die' and 'perldoc -f warn' for information on these handlers.


    We're not surrounded, we're in a target-rich environment!