diff --git a/C4/Context.pm b/C4/Context.pm index 4dcd743dd9..e81fd953ed 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -64,6 +64,11 @@ BEGIN { print ""; } CGI::Carp::set_message(\&handle_errors); + ## give a stack backtrace if KOHA_BACKTRACES is set + ## can't rely on DebugLevel for this, as we're not yet connected + if ($ENV{KOHA_BACKTRACES}) { + $main::SIG{__DIE__} = \&CGI::Carp::confess; + } } # else there is no browser to send fatals to! $VERSION = '3.00.00.036'; }