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

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

Merged
merged 8 commits into from
Aug 14, 2024

Conversation

achingbrain
Copy link
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
24 checks passed
@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
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