[dancer-users] http_throw and Dancer2

Paul Clements paul.clements at us.sios.com
Sat Feb 6 14:34:23 EST 2021


On Thu, Feb 4, 2021 at 9:06 AM Andrew Beverley <andy at andybev.com> wrote:
> The idea is that you throw an exception anywhere:
>
>   error __x"Invalid email address: {email}", email => $email
>
> Then it ends up in the fatal_handler to return the custom response

One question:
This is all working great and I'm getting the correct HTTP responses,
but (at least in development mode) I'm also getting a stack trace
logged for every "error" call. Is there maybe a way to suppress the
stack trace for expected exceptions? Ideally, I'd like to see stack
traces for 500 errors, but not 4xx ones.

Thanks,
Paul


More information about the dancer-users mailing list