barc/express-hbs — pull request #48 by ErisDS (2014-01-22 20:30:28+00:00)
Title: Handle parser errors from handlebars

fixes #47

This try-catch block at the very least ensures that parse errors are caught by express-hbs and passed into the express flow to be handled by any errorhandling middleware that is defined. However, the error message only contains the line-number, not the filename.

I looked at adding the filename to the error message, however because of the way express-hbs caches layouts and renders them in an abstracted way, this is going to be difficult to achieve.

Therefore, I'm submitting this, because it does at least fix error handling and is relatively straightforward.