elixir-plug / plug_cowboy

Plug adapter for the Cowboy web server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Logging non-500 exceptions

arkgil opened this issue · comments

Currently Plug.Cowboy.Translator only logs exceptions that were raised in the Plug pipeline only if the Plug.Exception.status/1 for the error returns a status code greater than or equal to 500:

if non_500_exception?(reason) do
:skip
else

Would you be open for making this behaviour configurable? My thinking is that while implementing Plug.Exception is a great way to customize status codes (and in case of Phoenix, rendered responses), it's not always desirable to swallow the exception completely.

We can make it customizable, yes. Probably need to use the app environment, PRs are welcome!