Removed onCriticalError setting because the showDebug setting made it unnecessary.
This commit is contained in:
parent
6ab673f5ba
commit
079109dc52
3 changed files with 64 additions and 21 deletions
|
|
@ -15,10 +15,9 @@ use WebGUI::Session;
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub fatalError {
|
||||
my ($key, $log, $cgi, $logfile, $config, $friendly);
|
||||
my ($key, $log, $cgi, $logfile, $config);
|
||||
if (exists $session{cgi}) {
|
||||
$cgi = $session{cgi};
|
||||
$friendly = 1 if ($session{setting}{onCriticalError} eq "friendly");
|
||||
print WebGUI::Session::httpHeader();
|
||||
} else {
|
||||
use CGI;
|
||||
|
|
@ -32,38 +31,38 @@ sub fatalError {
|
|||
$config = new Data::Config '../etc/WebGUI.conf';
|
||||
$logfile = $config->param('logfile');
|
||||
}
|
||||
print "<h1>WebGUI Fatal Error</h1>Something unexpected happened that caused this system to fault.<p>" unless ($friendly);
|
||||
print "<h1>WebGUI Fatal Error</h1>Something unexpected happened that caused this system to fault.<p>" if ($session{setting}{showDebug});
|
||||
$log = FileHandle->new(">>$logfile") or print "Can't open log file: ".$logfile
|
||||
."\n<p>Check your WebGUI configuration file to set the path of the log file,
|
||||
and check to be sure the web server has the privileges to write to the log file.";
|
||||
print $0." at ".localtime(time)." reported:<br>" unless ($friendly);
|
||||
print $0." at ".localtime(time)." reported:<br>" if ($session{setting}{showDebug});
|
||||
print $log localtime(time)." ".$0." FATAL: ".$_[0]."\n";
|
||||
print $_[0] unless ($friendly);
|
||||
print "<p><h3>Caller</h3><table border=1><tr><td valign=top>" unless ($friendly);
|
||||
print "<b>Level 1</b><br>".join("<br>",caller(1)) unless ($friendly);
|
||||
print $_[0] if ($session{setting}{showDebug});
|
||||
print "<p><h3>Caller</h3><table border=1><tr><td valign=top>" if ($session{setting}{showDebug});
|
||||
print "<b>Level 1</b><br>".join("<br>",caller(1)) if ($session{setting}{showDebug});
|
||||
print $log "\t".join(",",caller(1))."\n";
|
||||
print "</td><td valign=top>"."<b>Level 2</b><br>".join("<br>",caller(2)) unless ($friendly);
|
||||
print "</td><td valign=top>"."<b>Level 2</b><br>".join("<br>",caller(2)) if ($session{setting}{showDebug});
|
||||
print $log "\t".join(",",caller(2))."\n";
|
||||
print "</td><td valign=top>"."<b>Level 3</b><br>".join("<br>",caller(3)) unless ($friendly);
|
||||
print "</td><td valign=top>"."<b>Level 3</b><br>".join("<br>",caller(3)) if ($session{setting}{showDebug});
|
||||
print $log "\t".join(",",caller(3))."\n";
|
||||
print "</td><td valign=top>"."<b>Level 4</b><br>".join("<br>",caller(4)) unless ($friendly);
|
||||
print "</td><td valign=top>"."<b>Level 4</b><br>".join("<br>",caller(4)) if ($session{setting}{showDebug});
|
||||
print $log "\t".join(",",caller(4))."\n";
|
||||
print "</td></tr></table>" unless ($friendly);
|
||||
print "<h3>Form Variables</h3>" unless ($friendly);
|
||||
print "</td></tr></table>" if ($session{setting}{showDebug});
|
||||
print "<h3>Form Variables</h3>" if ($session{setting}{showDebug});
|
||||
print $log "\t";
|
||||
if (exists $session{form}) {
|
||||
foreach $key (keys %{$session{form}}) {
|
||||
print $key." = ".$session{form}{$key}."<br>" unless ($friendly);
|
||||
print $key." = ".$session{form}{$key}."<br>" if ($session{setting}{showDebug});
|
||||
print $log $key."=".$session{form}{$key}." ";
|
||||
}
|
||||
print $log "\n";
|
||||
} else {
|
||||
print "Cannot retrieve session information." unless ($friendly);
|
||||
print "Cannot retrieve session information." if ($session{setting}{showDebug});
|
||||
print $log "Session not accessible for form variable dump.\n";
|
||||
}
|
||||
print $log "\n";
|
||||
$log->close;
|
||||
if ($friendly) {
|
||||
unless ($session{setting}{showDebug}) {
|
||||
print WebGUI::International::get(416).'<br>';
|
||||
print '<br>'.$session{setting}{companyName};
|
||||
print '<br>'.$session{setting}{companyEmail};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue