package TestApp::Context;
use Moose;
extends 'Catalyst::Context';
+with 'Catalyst::TraitFor::Context::TestHeaders',
+ 'Catalyst::TraitFor::Context::TestErrors',
+ 'Catalyst::TraitFor::Context::TestPluginServer';
if (eval { Class::MOP::load_class('CatalystX::LeakChecker'); 1 }) {
with 'CatalystX::LeakChecker';
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::method(@_);
+
+ $c->res->status(500);
+ $c->res->body( 'FATAL ERROR: ' . join( ', ', @{ $c->error } ) );
+}
1;