-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix: ensure errors keep their message and stack after toJSON serialisation
#8053
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
fix: ensure errors keep their message and stack after toJSON serialisation
#8053
Conversation
✅ Deploy Preview for vitest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| // stack is not serialized in worker communication | ||
| // we stringify it first | ||
| if (typeof err.stack === 'string') { | ||
| err.stackStr = String(err.stack) | ||
| } | ||
| if (typeof err.name === 'string') { | ||
| err.nameStr = String(err.name) | ||
| } | ||
|
|
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 was feeling this is mostly redundant for a long time 😄
|
Seems this PR breaks our code because we use |
Yes, use |
By the way, note that Vitest 4 will remove |
|
I see. Good to know. Thanks. |
Fixes #8040
Description
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.