bminer / node-blade

Blade - HTML Template Compiler, inspired by Jade & Haml
Other
320 stars 28 forks source link

Always catch runtime errors #191

Closed jessetane closed 10 years ago

jessetane commented 11 years ago

I noticed that my express app would crash when minify was set to true (and a template had a runtime error) instead of allowing me the chance to serve a nicely formatted 500. Does catching / not catching runtime errors have something to do with minification? I am assuming runtime.rethrow was affected as you can see in my pull request.

Also, the minify option was set for the middleware - it seems maybe confusing to me that these options also affect express's view engine (server-side rendering), so maybe there is a separate issue there?

jessetane commented 11 years ago

@bminer, any thoughts?

bminer commented 10 years ago

@jessetane - There was a reason why I wasn't passing errors through runtime.rethrow, but I forget what it is. Nevertheless, template errors should definitely be caught no matter what, so your pull request is perfectly fine.

I will merge this. Thanks!