Skip to content

feat!: use .name property instead of .code for errors#2655

Merged
achingbrain merged 8 commits intorelease-v2.0from
feat/errors-with-name-property
Aug 14, 2024
Merged

feat!: use .name property instead of .code for errors#2655
achingbrain merged 8 commits intorelease-v2.0from
feat/errors-with-name-property

Conversation

@achingbrain
Copy link
Copy Markdown
Member

@achingbrain achingbrain commented Aug 8, 2024

JavaScript errors have a .name property that can be used to disambiguate the type of error.

libp2p has used the .code property for this until now, but we will soon use that field to indicate remote errors, so switch to using the .name property.

Fixes #2634

BREAKING CHANGE: The .code property has been removed from most errors, use .name instead

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if necessary (this includes comments as well)
  • I have added tests that prove my fix is effective or that my feature works

JavaScript errors have a `.name` property that can be used to
disambiguate the type of error.

libp2p has used the `.code` property for this until now, but we will
soon use that field to indicate remote errors, so switch to using
the `.name` property.

BREAKING CHANGE: The `.code` property has been removed from most errors, use `.name` instead
@achingbrain achingbrain added the version-2.0 PRs that will be released in libp2p v2 label Aug 8, 2024
@achingbrain achingbrain requested a review from a team as a code owner August 8, 2024 13:40
@achingbrain achingbrain mentioned this pull request Aug 8, 2024
27 tasks
@achingbrain achingbrain merged commit e42da78 into release-v2.0 Aug 14, 2024
@achingbrain achingbrain deleted the feat/errors-with-name-property branch August 14, 2024 15:54
achingbrain added a commit that referenced this pull request Sep 6, 2024
JavaScript errors have a `.name` property that can be used to
disambiguate the type of error.

libp2p has used the `.code` property for this until now, but we will
soon use that field to indicate remote errors, so switch to using
the `.name` property.

BREAKING CHANGE: The `.code` property has been removed from most errors, use `.name` instead
achingbrain added a commit that referenced this pull request Sep 6, 2024
JavaScript errors have a `.name` property that can be used to
disambiguate the type of error.

libp2p has used the `.code` property for this until now, but we will
soon use that field to indicate remote errors, so switch to using
the `.name` property.

BREAKING CHANGE: The `.code` property has been removed from most errors, use `.name` instead
achingbrain added a commit that referenced this pull request Sep 6, 2024
JavaScript errors have a `.name` property that can be used to
disambiguate the type of error.

libp2p has used the `.code` property for this until now, but we will
soon use that field to indicate remote errors, so switch to using
the `.name` property.

BREAKING CHANGE: The `.code` property has been removed from most errors, use `.name` instead
@achingbrain achingbrain mentioned this pull request Sep 6, 2024
julienmalard added a commit to julienmalard/orbitdb that referenced this pull request Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

version-2.0 PRs that will be released in libp2p v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant