jeudi 11 janvier 2018

How can I display a custom error page with Ruby on Rails in any failure case?

I know that if an exception is raised in my main app, I can use the exceptions_app configuration attribute to serve a dynamic error page.

However, if this error page is dynamic, it might also fail. In my case, I'm sharing some of the display logic with the main app, and it happened that that logic was the source of the exception, and rendering the error page raised it again. My end users then saw the Passenger error page, which is all purple and weird and frightening.

How can I reliably display a custom error page to my users, possibly with a static page fallback?

Aucun commentaire:

Enregistrer un commentaire