Enable Exception Fallback/Failsafe Behavior #8425

Closed
wants to merge 1 commit into
from

Projects

None yet

5 participants

@schneems
Ruby on Rails member

Right now we have a default error handling app ActionDispatch::PublicExceptions that renders the static 404 & 500 pages. If you don't like it you can override this behavior by specifying an exceptions app in the config of your application using config.exceptions_app. Right now if you do so, and you have an exception in your exceptions app, your users will not see your 404 or 500 pages, but instead a FAILSAFE_RESPONSE that simply renders some text.

This change gives the ability to have MULTIPLE fallback apps. So anyone can write exception handling apps, and if those apps fail, it will continue to try to use the public app. This design also allows the developer to specify additional apps if they choose.

There are two key things in this PR, first that this fallback behavior to the public exceptions app is automatic, and second that by default you can specify multiple error rendering apps.

This is an alternative implementation of an existing PR #7804 made at the behest of @jeremy. I believe this is a cleaner implementation.

ATP railties and actionpack cc/ @rafael @rafaelfranca @spastorino @steveklabnik

@schneems schneems Enable Exception Fallback/Failsafe Behavior
Right now we have a default error handling app `ActionDispatch::PublicExceptions` that renders the static 404 & 500 pages. If you don't like it you can override this behavior by specifying an exceptions app in the config of your application using `config.exceptions_app`. Right now if you do so, and you have an exception in your exceptions app, your users will not see your 404 or 500 pages, but instead a FAILSAFE_RESPONSE that simply renders some text.

This change gives the ability to have MULTIPLE fallback apps. So anyone can write exception handling apps, and if those apps fails, it will continue to try to use the public app. This design also allows the developer to specify additional apps if they choose.

There are two key things in this PR, first that this fallback behavior to the public exceptions app is automatic, and second that by default you can specify multiple apps.

This is an alternative implementation of an existing PR #7804 made at the behest of @jeremy. I believe this is a cleaner implementation.

ATP railties and actionpack cc/ @rafael @rafaelfranca @spastorino @steveklabnik
5c5b023
@laserlemon

"Exception in your exceptions app" == inception app

@steveklabnik
Ruby on Rails member

Looks fine to me.

@schneems
Ruby on Rails member

fun story, i just got assigned this issue from codetriage: So, ping.

@lukaszx0
Ruby on Rails member

@schneems What's the status here? Can #7804 be closed? I guess if any of them will be merged, it'll be this one.

@Intrepidd

This issue has gone stale. @schneems do you still want it merged ? If so, maybe you should rebase with master and add a changelog entry, it might speed things up.

@schneems schneems closed this Apr 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment