From cfc0e33829d24a967eb51aad34d8dab3ab84a1b5 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 27 Mar 2008 14:40:14 -0500 Subject: [PATCH] improved formatting of fatal error messages sent to browser Signed-off-by: Joshua Ferraro --- C4/Context.pm | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/C4/Context.pm b/C4/Context.pm index c8b6d1e3a7..f7043aa026 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -27,28 +27,38 @@ BEGIN { my $msg = shift; my $debug_level = C4::Context->preference("DebugLevel"); + print q( + + Koha Error + + ); if ($debug_level eq "2"){ # debug 2 , print extra info too. my %versions = get_versions(); # a little example table with various version info"; print " -

debug level $debug_level

-

Got an error: $msg

+

Koha error

+

The following error has occurred:

+

$msg

- - - - - + + + + +
Apache $versions{apacheVersion}
Koha $versions{kohaVersion}
MySQL $versions{mysqlVersion}
OS $versions{osVersion}
Perl $versions{perlVersion}
Apache $versions{apacheVersion}
Koha $versions{kohaVersion}
MySQL $versions{mysqlVersion}
OS $versions{osVersion}
Perl $versions{perlVersion}
"; } elsif ($debug_level eq "1"){ - print "

debug level $debug_level

"; - print "

Got an error: $msg

"; + print " +

Koha error

+

The following error has occurred:

+

$msg

"; } else { - print "production mode - trapped fatal"; + print "

production mode - trapped fatal error

"; } + print ""; } CGI::Carp::set_message(\&handle_errors); } # else there is no browser to send fatals to! -- 2.39.2