X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=10966eb81ed4bfda373b145b3f20cde43c5bf6b0;hb=dfcb05ee2d4e9481368622f6924e162de323b23b;hp=571b120cd89ff8d036196637bffa0e761df2016d;hpb=6e94698dcf3a2dca78fd6f572c0860a1e386b118;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 571b120..10966eb 100755 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -126,7 +126,7 @@ __PACKAGE__->stats_class('Catalyst::Stats'); # Remember to update this in Catalyst::Runtime as well! -our $VERSION = '5.90062'; +our $VERSION = '5.90063'; sub import { my ( $class, @arguments ) = @_; @@ -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; }