[Catalyst-commits] r6215 - trunk/Catalyst-Runtime/t/lib
andyg at dev.catalyst.perl.org
andyg at dev.catalyst.perl.org
Tue Mar 27 22:36:01 GMT 2007
Author: andyg
Date: 2007-03-27 22:36:01 +0100 (Tue, 27 Mar 2007)
New Revision: 6215
Modified:
trunk/Catalyst-Runtime/t/lib/TestApp.pm
Log:
When testing and something crashes, don't display the HTML error page, but rather show the real error(s)
Modified: trunk/Catalyst-Runtime/t/lib/TestApp.pm
===================================================================
--- trunk/Catalyst-Runtime/t/lib/TestApp.pm 2007-03-27 20:25:45 UTC (rev 6214)
+++ trunk/Catalyst-Runtime/t/lib/TestApp.pm 2007-03-27 21:36:01 UTC (rev 6215)
@@ -55,6 +55,17 @@
return $c->SUPER::execute(@_);
}
+# Replace the very large HTML error page with
+# useful info if something crashes during a test
+sub finalize_error {
+ my $c = shift;
+
+ $c->NEXT::finalize_error(@_);
+
+ $c->res->status(500);
+ $c->res->body( 'FATAL ERROR: ' . join( ', ', @{ $c->error } ) );
+}
+
sub class_forward_test_method :Private {
my ( $self, $c ) = @_;
$c->response->headers->header( 'X-Class-Forward-Test-Method' => 1 );
More information about the Catalyst-commits
mailing list