blaze
blaze copied to clipboard
Template exceptions are using console.log not console.error
We dont see template exceptions bubble up into our unhandled exception handler (Sentry) because Blaze catches them and reports to console as info, instead of as error.


Equally what if I want my app to fail fast on any template error instead of continuing in a broken state? This is not possible because blaze doesn't have option to rethrow/bubble up unhandled?
We're using Meteor 1.10.1
Although this sounds like a reasonable change to Blaze it could cause side effects on legacy apps.
Maybe a simple fix is to overwrite Blaze._reportException = (e, msg) => console.error(e, msg) in your app.
We could also add this new feature as an option, like log levels.
Like on mongo package we allow many config options via settings, see one example https://docs.meteor.com/api/collections.html#mongo_connection_options_settings
We could have something like:
"packages": {
"blaze": {
"logLevel": {
"error": "error"
}
}
}
and in this case the default would be and not requiring any setting.
"logLevel": {
"error": "info"
}
Hi, as we are not having many discussions around this issue I'm closing it.
Of course, if we have new ideas or problems we can re-open it. No problem.
Hi @filipenevola sorry I didn't come back on your suggestion, it was simply because I thought it was a final proposal and I agreed 100% :)
Ultimately our only option to get visibility on critical issues happening in our app today (via Sentry.io for example) will be to monkey patch the log handling as suggested by @softwarerero which leaves me concerned about unexpected future breakages and unexpected behaviour.
Having first class logger support and options like you have suggested would be amazing
A similar annoyance for the community is the way Method callbacks squash exceptions that are rethrown as well :
https://forums.meteor.com/t/sentry-raven-with-meteor-on-server/32383/20
If you are planning improvements, recommend looking at what you can do here too
Maybe we could utilize the logging package for this and then we would have one central place to make additional improvements.