Skip to content

fix: replace err-code with CodeError #317

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

Merged
merged 3 commits into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@
"dependencies": {
"@chainsafe/is-ip": "^2.0.1",
"@chainsafe/netmask": "^2.0.0",
"@libp2p/interfaces": "^3.3.1",
"dns-over-http-resolver": "^2.1.0",
"err-code": "^3.0.1",
"multiformats": "^11.0.0",
"uint8arrays": "^4.0.2",
"varint": "^6.0.0"
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { getProtocol, names } from './protocols-table.js'
import varint from 'varint'
import { CID } from 'multiformats/cid'
import { base58btc } from 'multiformats/bases/base58'
import errCode from 'err-code'
import { CodeError } from '@libp2p/interfaces/errors'
import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
import { equals as uint8ArrayEquals } from 'uint8arrays/equals'

Expand Down Expand Up @@ -716,7 +716,7 @@ class DefaultMultiaddr implements Multiaddr {

const resolver = resolvers.get(resolvableProto.name)
if (resolver == null) {
throw errCode(new Error(`no available resolver for ${resolvableProto.name}`), 'ERR_NO_AVAILABLE_RESOLVER')
throw new CodeError(`no available resolver for ${resolvableProto.name}`, 'ERR_NO_AVAILABLE_RESOLVER')
}

const addresses = await resolver(this, options)
Expand Down