-
Couldn't load subscription status.
- Fork 42
Closed
Description
I have a Phoenix project and in my router.ex file I tried to define a handle_errors/2 callback as defined in the docs, so that I could change some errors I was handing back to users.
Unfortunately this did not work because the handle_errors defined in Plugsnag are being inserted above my definition.
Example:
defmodule ApiWeb.Router do
use Plug.Router
use Plugsnag
# Never gets triggered
defp handle_errors(conn, %{kind: _kind, reason: _reason, stack: _stack}) do
send_resp(conn, conn.status, "Something went wrong")
end
end
I believe that the handle_errors/2 definitions need to be moved from __using__ into a new __before_compile__ block, so that definitions in the application router will be inserted above those in Plugsnag macro.
I can prepare the change if this repo is still active.
stephanos and curtiseppel
Metadata
Metadata
Assignees
Labels
No labels