Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

chore: replace err-code with error-code #284

Closed
wants to merge 1 commit into from

Conversation

tabcat
Copy link
Contributor

@tabcat tabcat commented Nov 11, 2022

Replaces #278 which goes into more detail

Tried to find a libp2p repo that uses the props feature but was unsuccessful. Added the generic usage for props to code-err tests.

error-code package is not published yet but documentation has been added. Also the class is named and imported as ErrorCode instead of CodeError like the OP; can change it back but thought this worked fine.

@wemeetagain

Before Merging:

  • Obtain a package name tabcat/code-err#1
  • publish and install code-err package from npm
  • get feedback on changes made here before other libp2p packages
  • create issue to track all related PRs for libp2p packages, including this one

@tabcat tabcat changed the title chore: repace err-code with error-code chore: replace err-code with error-code Nov 11, 2022
@p-shahi p-shahi requested a review from wemeetagain November 15, 2022 16:05
@mpetrunic mpetrunic added the need/author-input Needs input from the original author label Nov 15, 2022
@tabcat
Copy link
Contributor Author

tabcat commented Nov 18, 2022

Anything needed before doing the same to the other libp2p packages?

@tabcat
Copy link
Contributor Author

tabcat commented Nov 21, 2022

Happy to install into libp2p* packages this week if everything is fine. Can talk about supply-chain/repo ownership if concerned. Email is on my profile.

@wemeetagain
Copy link
Member

Hey we just discussed this and the supply-chain issue in our triage call. We think it would be good to maintain this under the libp2p org.
Can you make a PR to add the CodeError code here? https://github.com/libp2p/js-libp2p-interfaces/blob/master/packages/interfaces/src/errors.ts
This would make CodeError available like so:
import { CodeError } from '@libp2p/interfaces/errors'

@tabcat tabcat closed this Nov 22, 2022
achingbrain added a commit to libp2p/js-libp2p-interfaces that referenced this pull request Jan 3, 2023
Adds [CodeError](libp2p/js-libp2p#1269) to errors.ts

Related: libp2p/js-libp2p-crypto#284 (comment)

Added public to props and code to match AbortCode style.

Also recently added the custom [Error.name](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name) property to [code-err](https://github.com/tabcat/code-err) implementation.

Co-authored-by: Alex Potsides <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
need/author-input Needs input from the original author
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants