package HTML::Mason::Commands; use strict; use vars qw($m $r); my $_escape = \&HTML::Mason::Parser::_escape_perl_expression; HTML::Mason::Component::FileBased->new ( 'code'=>sub { my %ARGS; if (@_ % 2 == 0) { %ARGS = @_ } else { die "Odd number of parameters passed to component expecting name/value pairs" } my $fault = (!exists $ARGS{'fault'} ? undef : $ARGS{'fault'}); my $more_err = (!exists $ARGS{'more_err'} ? undef : $ARGS{'more_err'}); my $_out = $m->current_sink; $m->debug_hook($m->current_comp->path) if (%DB::); ; # Clear out messages - they're likely irrelevant now. clear_msg(); unless ($fault) { my %h = $r->headers_in; $fault = Bric::Util::Fault::Exception::AP->new( { msg => $h{BRIC_ERR_MSG} || 'No error message found', payload => $h{BRIC_ERR_PAY} }); } $_out->(' System Error

System Error

'); if (Bric::Config::QA_MODE) { $m->comp('/widgets/qa/qa.mc'); $_out->(' '); } $_out->('

An exception was thrown:

Fault Type: '); $_out->( ref $fault ); $_out->('
Timestamp: '); $_out->( strfdate($fault->get_timestamp) ); $_out->('
Package: '); $_out->( $fault->get_pkg ); $_out->('
Filename: '); $_out->( $fault->get_filename ); $_out->('
Line: '); $_out->( $fault->get_line ); $_out->('
Message: '); $_out->( $fault->get_msg . ($more_err ? "\n\n$more_err" : '') ); $_out->('

Payload:

');
$_out->( $fault->get_payload );
$_out->('

Stack:
'); $_out->( join("
\n", map { ref $_ ? join(' - ', @{$_}[1,3,2]) : $_ } @{$fault->get_stack} ) ); $_out->('

'); $m->comp('/widgets/debug/debug.mc'); $_out->('
Email the Bricolage Developers
'); $_out->(' '); return undef; }, 'create_time'=>1001668584, 'declared_args'=> { '$more_err' => { 'default' => ' undef' }, '$fault' => { 'default' => ' undef' } }, 'object_size'=>2380, 'parser_version'=>0.8 ) ;