From: Shane M. <hal...@gm...> - 2006-08-29 02:43:09
|
Never mind.... The answer, of course, is that in a plugin the "context" parameter has an "error" method that you can query to see if there was an exception thrown. Thanks Dave etc! Nice design. Too bad I can't read manual pages :-( On 8/28/06, Shane McCarron <hal...@gm...> wrote: > > I have a plugin that implements content compression. It works well except > when there is an exception thrown and we are running under mod_perl. My > custom handler looks like the following > > sub handler > { > my ($r) = @_; > return -1 if $r->content_type && $r->content_type !~ m|^text/|i; > > my $status = eval { $ah->handle_request($r); }; > > if ( $@ ) > { > my $err = UNIVERSAL::can($@, 'as_string') ? $@->as_string : "$@"; > $r->pnotes( errormessage => $err ); > $r->filename( "error_report.mpl" ); > > return $ah->handle_request($r); > } > > return $status; > } > > I am wondering if, in my exception handling clause, there is a way I can > access the underlying mason request so I can clear its buffer? Or a way to > tell a mason plugin that a new request is starting? Otherwise, the second > handle_request call doesn't seem to correctly get its output processed and, > as a result, my error reports come out with no content. > -- > Shane McCarron > hal...@gm... > -- -- Shane McCarron hal...@gm... |