Don't stringify blessed errors in ->execute
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine.pm
index ee6afcb..a095811 100644 (file)
@@ -205,8 +205,12 @@ sub execute {
         else { $c->state( &$code( $class, $c, @{ $c->req->args } ) ) }
     };
     if ( my $error = $@ ) {
-        chomp $error;
-        $error = qq/Caught exception "$error"/;
+
+        unless ( ref $error ) {
+            chomp $error;
+            $error = qq/Caught exception "$error"/;
+        }
+        
         $c->log->error($error);
         $c->error($error);
         $c->state(0);