reverting (most of) the whitespace changes
[catagits/Catalyst-Runtime.git] / t / lib / Catalyst / Plugin / Test / Errors.pm
index 3365e2f..b040b1c 100644 (file)
@@ -1,12 +1,13 @@
 package Catalyst::Plugin::Test::Errors;
 
 use strict;
+use NEXT;
 
 sub error {
     my $c = shift;
 
     unless ( $_[0] ) {
-        $c->NEXT::error(@_);
+        return $c->NEXT::error(@_);
     }
 
     if ( $_[0] =~ /^(Unknown resource|No default action defined)/ ) {
@@ -21,7 +22,10 @@ sub error {
         $c->response->status(500);
     }
 
-    $c->response->headers->push_header( 'X-Catalyst-Error' => $_[0] );
+    my $error = $_[0];
+    $error =~ s/\n/, /g;
+
+    $c->response->headers->push_header( 'X-Catalyst-Error' => $error );
 
     $c->NEXT::error(@_);
 }