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->('
An exception was thrown:
Fault Type: '); $_out->( ref $fault ); $_out->('Payload:
Stack:'); $_out->( $fault->get_payload ); $_out->('