X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst.pm;h=ddc77f6e71b86b7bb5564d3425515a5d84e752bc;hp=725494c7cff2bd33f9b45e8e458ccf193fa95596;hb=32ed98de51991a84501ab4d32ff4db4fb7f128ad;hpb=c0d561c143f688e7fb322fcf0b2e8ca64022e7d8 diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 725494c..ddc77f6 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -1802,7 +1802,15 @@ sub execute { if ( my $error = $@ ) { #rethow if this can be handled by middleware - if(blessed $error && ($error->can('as_psgi') || $error->can('code'))) { + if( + blessed $error && ( + $error->can('as_psgi') || + ( + $error->can('code') && + $error->code =~m/^[1-5][0-9][0-9]$/ + ) + ) + ) { foreach my $err (@{$c->error}) { $c->log->error($err); } @@ -2129,7 +2137,15 @@ sub handle_request { $status = $c->finalize; } catch { #rethow if this can be handled by middleware - if(blessed $_ && ($_->can('as_psgi') || $_->can('code'))) { + if( + blessed($_) && ( + $_->can('as_psgi') || + ( + $_->can('code') && + $_->code =~m/^[1-5][0-9][0-9]$/ + ) + ) + ) { $_->can('rethrow') ? $_->rethrow : croak $_; } chomp(my $error = $_);