You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just for anybody coming here I can achieve this with the following:
defmodule Web.ErrorView do
use Web, :view
# 404 Not Found following JSON:API
def render("404.json", _assigns) do
Jason.encode!(%{errors: [%{status: "401", title: "Not Found"}]})
end
end
It works, but won't allow me to easily test this in a controller test, because I need to catch the exception. Maybe jsonapi could catch the exception before Phoenix does and this way it would work? I am sorry I am just one-week-in in Phoenix so a bit hard for me to figure this out on my own.
Hello, first thanks for this library, looking great.
I am trying to test 404 endpoints and realized that jsonapi maybe does not catch
Ecto.NoResultsError
and does not show proper 404 error.It should show a JSON:API spec formatted error as for any other:
am I not realizing something? It feels like it counts on Phoenix to serve 404 error which is without the formatted message above.
The text was updated successfully, but these errors were encountered: