-
Notifications
You must be signed in to change notification settings - Fork 23
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
Bump serialize-error from 9.1.1 to 10.0.0 #3246
Bump serialize-error from 9.1.1 to 10.0.0 #3246
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3246 +/- ##
==========================================
- Coverage 35.27% 35.24% -0.04%
==========================================
Files 738 738
Lines 21102 21086 -16
Branches 4522 4518 -4
==========================================
- Hits 7444 7431 -13
+ Misses 12737 12735 -2
+ Partials 921 920 -1
Continue to review full report at Codecov.
|
@dependabot rebase |
Bumps [serialize-error](https://github.com/sindresorhus/serialize-error) from 9.1.1 to 10.0.0. - [Release notes](https://github.com/sindresorhus/serialize-error/releases) - [Commits](sindresorhus/serialize-error@v9.1.1...v10.0.0) --- updated-dependencies: - dependency-name: serialize-error dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]>
5450bf7
to
067af89
Compare
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.
You can see the changes I made to serialize-error
here: https://github.com/sindresorhus/serialize-error/releases/tag/v10.0.0
return { | ||
error: serializeError(error), | ||
error: serializeError(error, { useToJSON: false }), |
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.
Thanks to:
Unfortunately we can only make use of this feature when calling serializeError
directly. Since webext-messenger
calls serializeError
internally, we can't guarantee that toJSON
is ignored everywhere, so other delete axiosError.toJSON
calls will have to be preserved.
@@ -289,66 +282,39 @@ export function getRootCause(error: ErrorObject): ErrorObject { | |||
return error; | |||
} | |||
|
|||
// Manually list subclasses because the prototype chain is lost in serialization/deserialization | |||
// See https://github.com/sindresorhus/serialize-error/issues/48 | |||
const BUSINESS_ERROR_CLASSES = new Set([ |
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.
Dropped because it just duplicates the string set below. Once we fix the circular-reference issue we can use this set instead of the strings set.
// List all BusinessError subclasses as text: | ||
// - to avoid circular reference issues | ||
// - because not all of our errors can be deserialized with the right class: | ||
// https://github.com/sindresorhus/serialize-error/issues/72 |
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.
Subclass support is only possible if the constructor is compatible, but some of our constructors aren't:
So I'll look into using the correct constructor separately.
return ( | ||
isErrorObject(error) && | ||
(BUSINESS_ERROR_NAMES.has(error.name) || hasBusinessRootCause(error.cause)) | ||
); |
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.
Main changes:
- isErrorObject already includes a null check
- any error can now have a
cause
, so we don't need to limit this recursiveness to Context Errors
Bumps serialize-error from 9.1.1 to 10.0.0.
Release notes
Sourced from serialize-error's releases.
Commits
6f6102f
10.0.022b9bd4
Require Node.js 1449db63a
Preserve error constructor (#70)bdf7ad4
Deserialize nested errors (#69)e9e8666
AdduseToJSON
option (#71)392081c
Minor tweaksbb6d9d6
AddisErrorLike()
method (#68)adc780d
Fix.toJSON()
example7e8be51
Add support forcause
property (#65)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)