in reply to Dancer2 hook
hook after_error => sub { my $response = shift; }; [download]
https://metacpan.org/pod/Dancer2::Core::Hook