finalize_errors is in Context now (t/aggregate/live_component_controller_action_go...
[catagits/Catalyst-Runtime.git] / t / lib / TestApp / Context.pm
index 38e4bb8..f621996 100644 (file)
@@ -54,5 +54,16 @@ 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::method(@_);
+
+    $c->res->status(500);
+    $c->res->body( 'FATAL ERROR: ' . join( ', ', @{ $c->error } ) );
+}
+
 1;