fixed some xhhtml stuff

increased performance on burst protection
This commit is contained in:
JT Smith 2006-04-07 19:35:31 +00:00
parent ddeee5fbe8
commit adea847875
8 changed files with 34 additions and 30 deletions

View file

@ -170,7 +170,7 @@ sub error {
my $self = shift;
my $message = shift;
$self->getLogger->error($message);
$self->session->output->print("\n\n".$message.":\n".$self->getStackTrace());
$self->session->output->print("\n\n".$message.":\n".$self->getStackTrace(), 1);
$self->getLogger->debug("Stack trace for ERROR ".$message."\n".$self->getStackTrace());
$self->session->stow->set("debug_error", $self->session->stow->get("debug_error").$message."\n");
}
@ -191,19 +191,19 @@ sub fatal {
Apache2::RequestUtil->request->content_type('text/html') if ($self->session->request);
$self->getLogger->fatal($message);
$self->getLogger->debug("Stack trace for FATAL ".$message."\n".$self->getStackTrace());
$self->session->output->print($self->session->http->getHeader) if ($self->session->request);
$self->session->http->getHeader if ($self->session->request);
unless ($self->canShowDebug()) {
#NOTE: You can't internationalize this because with some types of errors that would cause an infinite loop.
$self->session->output->print("<h1>Problem With Request</h1>
We have encountered a problem with your request. Please use your back button and try again.
If this problem persists, please contact us with what you were trying to do and the time and date of the problem.");
$self->session->output->print('<br />'.$self->session->setting("companyName"));
$self->session->output->print('<br />'.$self->session->setting("companyEmail"));
$self->session->output->print('<br />'.$self->session->setting("companyURL"));
If this problem persists, please contact us with what you were trying to do and the time and date of the problem.",1);
$self->session->output->print('<br />'.$self->session->setting("companyName"),1);
$self->session->output->print('<br />'.$self->session->setting("companyEmail"),1);
$self->session->output->print('<br />'.$self->session->setting("companyURL"),1);
} else {
$self->session->output->print("<h1>WebGUI Fatal Error</h1><p>Something unexpected happened that caused this system to fault.</p>\n");
$self->session->output->print("<p>".$message."</p>\n");
$self->session->output->print($self->showDebug());
$self->session->output->print("<h1>WebGUI Fatal Error</h1><p>Something unexpected happened that caused this system to fault.</p>\n",1);
$self->session->output->print("<p>".$message."</p>\n",1);
$self->session->output->print($self->showDebug(),1);
}
$self->session->close();
die $message;

View file

@ -85,7 +85,7 @@ sub new {
#-------------------------------------------------------------------
=head2 print ( content )
=head2 print ( content, skipMacros )
Outputs content to either the web server or standard out, depending on which is available.
@ -93,12 +93,17 @@ Outputs content to either the web server or standard out, depending on which is
The content to output.
=head3 skipMacros
A boolean indicating whether to skip macro processing on this content.
=cut
sub print {
my $self = shift;
my $content = shift;
WebGUI::Macro::process($self->session, \$content);
my $skipMacros = shift;
WebGUI::Macro::process($self->session, \$content) unless $skipMacros;
print $content;
}