From: Andy Grundman Date: Tue, 27 Mar 2007 21:36:01 +0000 (+0000) Subject: When testing and something crashes, don't display the HTML error page, but rather... X-Git-Tag: 5.7099_04~212 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=8153c836a453c362f8d1a2c2bf94c17374f298af When testing and something crashes, don't display the HTML error page, but rather show the real error(s) --- diff --git a/t/lib/TestApp.pm b/t/lib/TestApp.pm index cdb9d6e..a349b9a 100644 --- a/t/lib/TestApp.pm +++ b/t/lib/TestApp.pm @@ -55,6 +55,17 @@ sub execute { 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 );