How can I add a custom header to my error pages?

:wave:

I think you can do it by implementing a Plug.Exception protocol for your errors:

defimpl Plug.Exception, for: Your.Error do
  def status(_), do: 400 # or anything else
  def actions(_), do: []
end

More info: Phoenix.NotAcceptableError - How can I return an error instead of having the app just have an exception? - #2 by idi527

1 Like