# Remember to update this in Catalyst::Runtime as well!
-our $VERSION = '5.90062';
+our $VERSION = '5.90063';
sub import {
my ( $class, @arguments ) = @_;
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;
}