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:
plug_cowboy/lib/plug/cowboy/translator.ex
Lines 31 to 33 in 8aa34d8
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!