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

Theme Errors should not crash the blog #1975

Closed
ErisDS opened this issue Jan 18, 2014 · 3 comments
Closed

Theme Errors should not crash the blog #1975

ErisDS opened this issue Jan 18, 2014 · 3 comments
Assignees
Labels
bug [triage] something behaving unexpectedly
Milestone

Comments

@ErisDS
Copy link
Member

ErisDS commented Jan 18, 2014

Issue Summary

This is the second part, or follow up to #1964

No matter what happens in a theme, or how bad an error is, the blog should not crash, it should just show a 500 error page with details of the error.

Steps to Reproduce

  • Add an invalid handlebars helper to a partial, such as {{http://my-ghost-blog.com}}
  • Add an empty partial and include it in the default template

Technical details:

  • Ghost Version: 0.4.0
  • Mode: Production
@xuduo35
Copy link
Contributor

xuduo35 commented Jan 20, 2014

The crash happens when res.render call express-hbs module. One way to catch this exception is:


    process.on('uncaughtException', function(err) {
      console.log(typeof err);
    });

But it's not friendly to user. I think Ghost can track all http connections, and send 500 error to them when this kind of exception happened.

There is a existed called 'domain' which is used to do this thing. You guys can try.

@ErisDS
Copy link
Member Author

ErisDS commented Jan 22, 2014

I have opened an issue and submitted a PR against express-hbs to fix this:

TryGhost/express-hbs#47

@ghost ghost assigned ErisDS Jan 22, 2014
@mgutz
Copy link

mgutz commented Jan 22, 2014

I merged and add the template filename to the error. Try [email protected] from npm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [triage] something behaving unexpectedly
Projects
None yet
Development

No branches or pull requests

3 participants