whitespace cleanup
[catagits/Catalyst-Runtime.git] / t / lib / Catalyst / Plugin / Test / Errors.pm
index 4dc0d57..01861b8 100644 (file)
@@ -1,29 +1,33 @@
 package Catalyst::Plugin::Test::Errors;
 
 use strict;
+use MRO::Compat;
 
 sub error {
     my $c = shift;
 
     unless ( $_[0] ) {
-        return $c->NEXT::error(@_);
+        return $c->next::method(@_);
     }
 
     if ( $_[0] =~ /^(Unknown resource|No default action defined)/ ) {
         $c->response->status(404);
     }
-    
+
     if ( $_[0] =~ /^Couldn\'t forward/ ) {
         $c->response->status(404);
-    }    
+    }
 
     if ( $_[0] =~ /^Caught exception/ ) {
         $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(@_);
+    $c->next::method(@_);
 }
 
 1;