phoenix_playground
phoenix_playground copied to clipboard
Endpoint example suppresses errors
When we run the endpoint example as-is, while the liveview runs fine, the causes of 404 or 500 errors are hard to determine. For example, visiting http://localhost:4000/doesnotexist shows this log:
18:05:49.789 [error] ** (ArgumentError) no "404" html template defined for Demo.ErrorView (the module does not exist)
(phoenix_template 1.0.4) lib/phoenix/template.ex:248: Phoenix.Template.render_with_fallback/4
(phoenix_template 1.0.4) lib/phoenix/template.ex:126: Phoenix.Template.render_to_iodata/4
(phoenix 1.7.17) lib/phoenix/controller.ex:1008: anonymous fn/5 in Phoenix.Controller.template_render_to_iodata/4
(telemetry 1.3.0) /Users/nt/Library/Caches/mix/installs/elixir-1.17.3-erts-15.1.2/4e7751a1ef5528a8cfb513058737ec81/deps/telemetry/src/telemetry.erl:324: :telemetry.span/3
(phoenix 1.7.17) lib/phoenix/controller.ex:974: Phoenix.Controller.render_and_send/4
(phoenix 1.7.17) lib/phoenix/endpoint/render_errors.ex:86: Phoenix.Endpoint.RenderErrors.instrument_render_and_send/5
(phoenix 1.7.17) lib/phoenix/endpoint/render_errors.ex:63: Phoenix.Endpoint.RenderErrors.__catch__/5
(bandit 1.6.1) lib/bandit/pipeline.ex:127: Bandit.Pipeline.call_plug!/2
Similar unhelpful message is shown when 500 errors happen.
I ran into this when trying to create a custom endpoint which would fix the problem of session being empty in the second mount/3 call.