Better error message if $c->forward fails to find action or component
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine.pm
index 3879058..8a0d54c 100644 (file)
@@ -286,7 +286,7 @@ sub finalize_error {
 
     my ( $title, $error, $infos );
     if ( $c->debug ) {
-        $error = join '<br/>', @{ $c->error };
+        $error = join '', map { '<code class="error">'  .  encode_entities($_) . '</code>' } @{ $c->error };
         $error ||= 'No output';
         $title = $name = "$name on Catalyst $Catalyst::VERSION";
         my $req   = encode_entities Dumper $c->req;
@@ -362,6 +362,12 @@ sub finalize_error {
             margin: 4px;
             -moz-border-radius: 10px;
         }
+        code.error {
+            display: block;
+            margin: 1em 0;
+            overflow: auto;
+            white-space: pre;
+        }
     </style>
 </head>
 <body>