Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails' cache method throws 500 error #21

Closed
coryodaniel opened this issue Jan 30, 2015 · 3 comments
Closed

Rails' cache method throws 500 error #21

coryodaniel opened this issue Jan 30, 2015 · 3 comments

Comments

@coryodaniel
Copy link

If you use Rails' cache method in a partial that gets rendered say during a 404, it will cause a 500 error to be thrown that seems to escalate out of gaffe's control and render the default rails 500 error page.

To reproduce it use a custom 'errors' layout and simply call the cache method around some content. I interestingly couldn't get it to fail in development, even with caching on, but running in staging or production it would fail using the same caching configuration.

@remi
Copy link
Member

remi commented Jan 30, 2015

Hi @coryodaniel,

This is the normal behavior when an error is raised while rendering a custom exception page.

I’m not really sure your error is related to Gaffe — did you try to render the same partial (with the cache call) in a page not rendered by Gaffe?

Also, Rails’ config.action_controller.perform_caching configuration option is set to false in development and true in production, so that might explain the behavior difference between those environments.

@coryodaniel
Copy link
Author

Yeah I had dev set to allow caching. Didn't know it was expected behavior. I had a custom exceptions_app and had the same problem. I'd figured I'd implemented it wrong and moved to gaffe. Case closed I suppose!

On Jan 30, 2015, at 3:04 AM, Rémi Prévost notifications@github.com wrote:

Hi @coryodaniel,

This is the normal behavior when an error is raised while rendering a custom exception page.

I’m not really sure your error is related to Gaffe — did you try to render the same partial (with the cache call) in a page not rendered by Gaffe?

Also, Rails’ config.action_controller.perform_caching configuration option is set to false in development and true in production, so that might explain the behavior difference between those environments.


Reply to this email directly or view it on GitHub.

@remi
Copy link
Member

remi commented Jan 30, 2015

Cool, glad to know I was helpful 😄 I’m gonna close this issue.

@remi remi closed this as completed Jan 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants