-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
feat: add logger.hasErrorLogged(error)
method
#3957
Conversation
Let's pass the error to |
..and require an `error` option to be defined when `logger.error` is called. BREAKING CHANGE
I've added the That makes this PR a breaking change. In Vite itself, most logged errors are not rethrown, so marking them is pointless, but I'm passing the |
loggedByVite
on errors logged by Vitelogger.hasLogged(error)
method
logger.hasLogged(error)
methodlogger.hasErrorLogged(error)
method
I see that there is a comment about a breaking change, @antfu is this safe to merge in the 2.5 beta? We'll do a beta-1 today so we could still include this one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have changed the options
argument to optional to avoid breaking changes.
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
Description
This makes it easier for frameworks which wrap Vite (eg:
vite-plugin-ssr
) to avoid logging an error that was already logged by Vite.Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).