You want to override the Catalyst dump_these method. This returns a list of things displayed on the Catalyst error debugging page.
The default implementation looks like this:
sub dump_these { my $c = shift; [ Request => $c->req ], [ Response => $c->res ], [ Stash => $c->stash ], [ Config => $c->config ]; }
but you can make it more restrictive, for example
sub dump_these { my $c = shift; return [ Apology => "We're sorry that you encountered a problem" ], [ Response => substr($c->res->body, 0, 512) ]; }
In the main application module, you define dump_these - the one where you use Catalyst .
source share