From 697088968a4be02c4eefee1ace170934e5daf9de Mon Sep 17 00:00:00 2001 From: MJ Ray Date: Tue, 1 Apr 2008 19:29:18 +0100 Subject: [PATCH] Add backtrace printing option through SetEnv KOHA_BACKTRACES 1 Signed-off-by: Joshua Ferraro --- C4/Context.pm | 5 +++++ 1 file changed, 5 insertions(+) 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'; } -- 2.39.5