Once this module is used, a callback named handle_errors/2 should
be defined in your plug. This callback will receive the connection
already updated with a proper status code for the given exception.
Since this callback is a public function and is not defined in a behaviour it feels like it needs a docstring. I think a @callback definition plus a @behaviour would be a "better" documentation as to what that function actually does. Just adding a @impl Plug.ErrorHandler would improve code navigation there and awareness of its functionality.
If you are not against this I can open a PR for that. Otherwise sorry for the noise :) It seems like a bug to me.
Documentation of
Plug.ErrorHandler
mentions this:Since this callback is a public function and is not defined in a behaviour it feels like it needs a docstring. I think a
@callback
definition plus a@behaviour
would be a "better" documentation as to what that function actually does. Just adding a@impl Plug.ErrorHandler
would improve code navigation there and awareness of its functionality.If you are not against this I can open a PR for that. Otherwise sorry for the noise :) It seems like a bug to me.