% # Check to see if this is a preview screen. % my $prev = $r->notes('burner.preview'); <& /widgets/wrappers/sharky/header.mc, title => 'Error', useSideNav => !$prev, no_toolbar => !$prev, context => 'An error occurred.', debug => QA_MODE || TEMPLATE_QA_MODE &>

<% $lang->maketext('An error occurred while processing your request:')%>

% if (isa_exception($fault)) {

<% escape_html($fault->error) %>

% } % if (isa_bric_exception($fault) and my $pay = $fault->payload) {
<% escape_html($pay) %>
% } % if (QA_MODE or (TEMPLATE_QA_MODE and $is_burner_error)) {
% if ($is_burner_error) {
Output Channel
<% $fault->oc || ' ' %>
Category
<% $fault->cat || ' ' %>
Element
<% $fault->elem || ' ' %>
% }
Fault Class
<% ref $fault %>
Description
<% $fault->description || ' ' %>
Timestamp
<% strfdate($fault->time) %>
Package
<% $fault->package || ' ' %>
Filename
<% $fault->file || ' ' %>
Line
<% $fault->line || ' ' %>

Stack:

<% HTML::Mason::Exceptions::isa_mason_exception($fault) ? $fault->as_text : $fault->trace->as_string %>
% if (QA_MODE) {

Request args:

% while (my ($arg, $value) = each %req_args) {
<% $arg %>
<% escape_html($value) %>
% }
<& '/widgets/debug/debug.mc' &> % }
% } else { % } % if ($prev && $is_burner_error) { % my $element = $fault->element; % my @elements = ($element); % while (my $parent = $elements[0]->get_parent) { % unshift @elements, $parent; % }

Location of the error:
<% shift(@elements)->get_name %> -> <% join(' -> ', map { $_->get_name . '[' . ($_->get_place + 1) . ']' } @elements) %>

% } % unless (isa_bric_exception($fault, 'Exception::Burner::User')) {

Please report this error to your administrator.

% } <& '/widgets/wrappers/sharky/footer.mc' &> % $r->status(Apache::Constants::HTTP_INTERNAL_SERVER_ERROR); % $m->abort; <%init>; # Clear out messages - they're likely irrelevant now. clear_msg(); # exception object ($fault) and $more_args are now always # in pnotes, not passed in %args my $fault = $r->pnotes('BRIC_EXCEPTION'); warn "'$fault' not an exception object" unless isa_exception($fault); my $more_err = $r->pnotes('BRIC_MORE_ERR'); my $pay = isa_bric_exception($fault) ? ($fault->payload || '') : ''; my $is_burner_error = isa_bric_exception($fault, 'Exception::Burner'); my %req_args = HTML::Mason::Request->instance->request_args;