sheerun / rails4-bootstrap

My systematic way of making bullet-proof Rails 4 bootstrap template.
21 stars 1 forks source link

Make error pages dynamic and customizable #26

Closed sheerun closed 11 years ago

sheerun commented 11 years ago

http://railscasts.com/episodes/53-handling-exceptions-revised

Reasoning

The solution is to define explicit controller for handling exceptions. That way you can use site layout template, SLIM, rails helpers etc. In general error pages become more dynamic.

Possible downsides

Error handling deadloop (error is thrown from error controller). I'll try to implement some safeguard for this case though. I think of fallback to public/500.html when there is an exception thrown in errors controller.

Also, to prevent such cases I think ExceptionsController should inherit directly from ActionController::Base, instead of ApplicationController. That should protect it from programming errors committed in ApplicationController.

sheerun commented 11 years ago

For not I cannot find any gem for it. The solution is easy enough to be implemented directly imho.

sheerun commented 11 years ago

Final decisions

sheerun commented 11 years ago

Tested for interoperation with Sentry (Raven) and error logging.