Fix bug from RT#46459, misc cleanups in Catalyst::Test
[catagits/Catalyst-Runtime.git] / lib / Catalyst.pm
index a751984..9a886e6 100644 (file)
@@ -1512,10 +1512,10 @@ sub execute {
 
     if ( my $error = $@ ) {
         if ( blessed($error) and $error->isa('Catalyst::Exception::Detach') ) {
-            die $DETACH if($c->depth > 1);
+            $error->rethrow if $c->depth > 1;
         }
         elsif ( blessed($error) and $error->isa('Catalyst::Exception::Go') ) {
-            die $GO if($c->depth > 0);
+            $error->rethrow if $c->depth > 0;
         }
         else {
             unless ( ref $error ) {
@@ -2511,7 +2511,7 @@ the plugin name does not begin with C<Catalyst::Plugin::>.
 
         $class->_plugins( {} ) unless $class->_plugins;
         $plugins ||= [];
-                
+
         my @plugins = Catalyst::Utils::resolve_namespace($class . '::Plugin', 'Catalyst::Plugin', @$plugins);
 
         for my $plugin ( reverse @plugins ) {