Skip to content

Commit

Permalink
fix: replace err-code with CodeError (#317)
Browse files Browse the repository at this point in the history
Related: libp2p/js-libp2p#1269

- deps: install @libp2p/interfaces
- fix: replace err-code with CodeError
- deps: remove err-code
  • Loading branch information
tabcat committed Apr 5, 2023
1 parent bc2c73a commit cb5ff5f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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

0 comments on commit cb5ff5f

Please sign in to comment.