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

Bump serialize-error from 9.1.1 to 10.0.0 #3246

Merged
merged 4 commits into from
May 3, 2022

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Apr 25, 2022

Bumps serialize-error from 9.1.1 to 10.0.0.

Release notes

Sourced from serialize-error's releases.

v10.0.0

Breaking

  • Require Node.js 14 22b9bd4
  • Preserve error constructor (#70) 49db63a
    • Previously it did not preserve built-in errors. It does now. So a TypeError might have been deserialized as a Error before, but is now deserialized as a TypeError.

Improvements

  • Deserialize nested errors (#69) bdf7ad4
  • Add useToJSON option (#71) e9e8666
  • Add isErrorLike() method (#68) bb6d9d6
  • Add support for cause property (#65) 7e8be51

sindresorhus/serialize-error@v9.1.1...v10.0.0

Commits

Dependabot compatibility score

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)

@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Apr 25, 2022
@dependabot dependabot bot requested a review from fregante April 25, 2022 08:17
@codecov-commenter
Copy link

codecov-commenter commented Apr 25, 2022

Codecov Report

Merging #3246 (6da2279) into main (1becd9a) will decrease coverage by 0.03%.
The diff coverage is 85.71%.

@@            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     
Impacted Files Coverage Δ
src/services/api.ts 31.95% <ø> (-0.05%) ⬇️
src/background/logging.ts 21.64% <50.00%> (ø)
src/errors.ts 81.48% <100.00%> (-0.70%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1becd9a...6da2279. Read the comment docs.

@fregante fregante self-assigned this Apr 25, 2022
@twschiller twschiller modified the milestones: 1.6.1, 1.6.2 Apr 26, 2022
@fregante
Copy link
Contributor

fregante commented May 3, 2022

@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]>
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/serialize-error-10.0.0 branch from 5450bf7 to 067af89 Compare May 3, 2022 05:10
Copy link
Contributor

@fregante fregante left a 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 }),
Copy link
Contributor

@fregante fregante May 3, 2022

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([
Copy link
Contributor

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
Copy link
Contributor

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.

Comment on lines +314 to +317
return (
isErrorObject(error) &&
(BUSINESS_ERROR_NAMES.has(error.name) || hasBusinessRootCause(error.cause))
);
Copy link
Contributor

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

@twschiller twschiller merged commit 04bb1d2 into main May 3, 2022
@twschiller twschiller deleted the dependabot/npm_and_yarn/serialize-error-10.0.0 branch May 3, 2022 14:05
@twschiller twschiller mentioned this pull request May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Development

Successfully merging this pull request may close these issues.

3 participants