How render error 404 with custom layout with Phoenix?

By default, when an Ecto.NoResultsError occurs, the 404.html file is rendered without layout.

How I could define a layout to be used in this error view?

These might help:

  • Phoenix’s error views page (this should address your question);
  • Phoenix’s custom errors page (in case you want to customise errors that go beyond the standard ones like 404 and 500).
1 Like