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

Template exceptions are using console.log not console.error #314

Open
haveaguess opened this issue Dec 15, 2020 · 6 comments · May be fixed by #368
Open

Template exceptions are using console.log not console.error #314

haveaguess opened this issue Dec 15, 2020 · 6 comments · May be fixed by #368
Labels
good-first-issue Good first issue or something that should is nice to do. ready We've decided how to solve or implement it
Milestone

Comments

@haveaguess
Copy link

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.

image

image

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

@filipenevola filipenevola transferred this issue from meteor/meteor Jan 17, 2021
@softwarerero
Copy link

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.

@filipenevola
Copy link
Collaborator

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"
}

@filipenevola filipenevola added the in-discussion We are still discussing how to solve or implement it label Mar 18, 2021
@filipenevola
Copy link
Collaborator

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.

@haveaguess
Copy link
Author

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

@haveaguess
Copy link
Author

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

@filipenevola filipenevola added ready We've decided how to solve or implement it and removed in-discussion We are still discussing how to solve or implement it labels Apr 23, 2021
@filipenevola filipenevola reopened this Apr 23, 2021
@StorytellerCZ
Copy link
Collaborator

Maybe we could utilize the logging package for this and then we would have one central place to make additional improvements.

@StorytellerCZ StorytellerCZ added the good-first-issue Good first issue or something that should is nice to do. label Jan 1, 2022
@jankapunkt jankapunkt linked a pull request Apr 14, 2022 that will close this issue
@StorytellerCZ StorytellerCZ added this to the Blaze 3.0 milestone Aug 5, 2022
@StorytellerCZ StorytellerCZ linked a pull request Mar 31, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-issue Good first issue or something that should is nice to do. ready We've decided how to solve or implement it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants