in reply to When Does FatalsToBrowser Not Send Fatals To Browser?
There are only 5 general cases where a "500 Internal Server Error" should be generated when you use CGI::Carp.
Obviously, the most likely issue is that the handler was not called for some reason.
Note that it is not called when inside an eval (well, it's called but just forwards the call onto realdie). That shouldn't matter, though, as the death will be trapped by the eval and, if it is propagated up, will be handled normally.
You should always put the use CGI::Carp ...; line before including any other modules and before any actual code. This greatly reduces the likelyhood of the handler not being installed before an error is generated.
There are ways to prevent (or trap) other code overwriting the $SIG{__DIE__} handler but it involves some possibly dicy magic and shouldn't be used in production code. You can see my Alarm::_TieSIG module to see how it would be done, and this discussion on why it is dicy.
bbfu
Black flowers blossum
Fearless on my breath
|
---|