X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst.pm;h=3ec38fcd0307aaca4b6437f7553a12f60e082f26;hp=571b120cd89ff8d036196637bffa0e761df2016d;hb=e25e23a7e56014e6c36e83e1b2d55106186ffe4d;hpb=6e94698dcf3a2dca78fd6f572c0860a1e386b118 diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 571b120..3ec38fc 100755 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -1738,6 +1738,10 @@ sub execute { my $last = pop( @{ $c->stack } ); if ( my $error = $@ ) { + #rethow if this can be handled by middleware + if(blessed $error && ($error->can('as_psgi') || $error->can('code'))) { + $error->can('rethrow') ? $error->rethrow : croak $error; + } if ( blessed($error) and $error->isa('Catalyst::Exception::Detach') ) { $error->rethrow if $c->depth > 1; }