Subject: | fatalsToBrowser, mod_perl2, eval interactions |
CGI::Carp, mod_perl2 and fatalsToBrowser, eval interactions, CGI.pm-3.49
Note: I would like to thank and compliment the developers and
supporters of CGI for an amazingly well done piece of work.
A problem sometimes encountered when using fatalsToBrowser is
when a C<die()> is done inside an C<eval> body or expression.
Even though the
fatalsToBrower support takes precautions to avoid this,
you still may get the error message printed to STDOUT.
This may have some undesireable effects when the purpose of doing the
eval is to determine which of several algorithms is to be used.
By setting C<$CGI::Carp::ToBrowser> to 0 you can suppress printing the
C<die> messages
but without all of the complexity of using C<set_die_handler>.
You can localize this effect to inside C<eval> bodies if this is desireable:
For example:
eval {
local $CGI::Carp::ToBrowser = 0;
die "Fatal error messages not sent browser"
}
# $@ will contain error message
A patch is attached which will implement this functionality and test it.
CGI::Carp and mod_perl2
There is a statement in the POD that fatalsToBrowser does not work with
mod_perl2. This apparently is not the case - it seems to work fine for
me (and some other testers). I suggest changing the word
or phrase 'does not' to 'may not'.
Subject: | CGI::Carp-diffs |
Message body not shown because it is not plain text.