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
Using Phoenix alone I handled missing data ("not found") by just using Ecto's ! functions (one! etc.). These raise an Ecto.NoResultsError, which Phoenix can handle via a Plug.Exception implementation to show a 404 page.
I'm now changing my app to use Absinthe.Phoenix.Controller and would like to know what's the best way to handle these cases.
My current approach looks like this, but it's quite repetitive. I'm using the new action_fallback macro from Phoenix 1.3.
Using Phoenix alone I handled missing data ("not found") by just using Ecto's
!
functions (one!
etc.). These raise anEcto.NoResultsError
, which Phoenix can handle via aPlug.Exception
implementation to show a 404 page.I'm now changing my app to use
Absinthe.Phoenix.Controller
and would like to know what's the best way to handle these cases.My current approach looks like this, but it's quite repetitive. I'm using the new
action_fallback
macro from Phoenix 1.3.Is there a better/ suggested way to do this properly?
The text was updated successfully, but these errors were encountered: