V1.3: Custom Error Pages
When an unsuccessful request is returned, there are some special pages that a Hanami application presents to users. These pages have a generic graphic and some basic information like the HTTP status code and the message.
Hanami allows us to customize them on a per-application basis.
We just need to create a template with the corresponding HTTP code as the filename (e.g. apps/web/templates/500.html.erb
).
From then on, all 500 errors (Internal Server Error) will be presented using that template (like for an exception that is not rescued).
500.html.erb
for Internal Server Error (500).
templates
directory of the application.