From 1acc90eb8474f0c33b823bed69341239dfaa85e9 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 27 Mar 2008 14:40:15 -0500 Subject: [PATCH] for DebugLevel=2; improved reporting of version numbers Koha software and DB version numbers now reported; also improved formatting of multi-line error messages. Signed-off-by: Joshua Ferraro --- C4/Context.pm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/C4/Context.pm b/C4/Context.pm index f7043aa026..4dcd743dd9 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -22,6 +22,8 @@ use vars qw($VERSION $AUTOLOAD $context @context_stack); BEGIN { if ($ENV{'HTTP_USER_AGENT'}) { require CGI::Carp; + # FIXME for future reference, CGI::Carp doc says + # "Note that fatalsToBrowser does not work with mod_perl version 2.0 and higher." import CGI::Carp qw(fatalsToBrowser); sub handle_errors { my $msg = shift; @@ -40,11 +42,12 @@ BEGIN { # a little example table with various version info"; print "

Koha error

-

The following error has occurred:

-

$msg

+

The following fatal error has occurred:

+
$msg
+ @@ -53,8 +56,8 @@ BEGIN { } elsif ($debug_level eq "1"){ print "

Koha error

-

The following error has occurred:

-

$msg

"; +

The following fatal error has occurred:

+
$msg
"; } else { print "

production mode - trapped fatal error

"; } @@ -960,7 +963,8 @@ Gets various version info, for core Koha packages, Currently called from carp ha # A little example sub to show more debugging info for CGI::Carp sub get_versions { my %versions; - $versions{kohaVersion} = C4::Context->config("kohaversion"); + $versions{kohaVersion} = KOHAVERSION(); + $versions{kohaDbVersion} = C4::Context->preference('version'); $versions{osVersion} = `uname -a`; $versions{perlVersion} = $]; $versions{mysqlVersion} = `mysql -V`; -- 2.39.5
Apache $versions{apacheVersion}
Koha $versions{kohaVersion}
Koha DB $versions{kohaDbVersion}
MySQL $versions{mysqlVersion}
OS $versions{osVersion}
Perl $versions{perlVersion}