Skip to content

Commit a02a0ce

Browse files
authored
fix: replace err-code with CodeError (#122)
1 parent 17607f4 commit a02a0ce

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,10 @@
139139
"@libp2p/interface-peer-id": "^2.0.0",
140140
"@libp2p/interface-peer-info": "^1.0.1",
141141
"@libp2p/interface-peer-routing": "^1.0.0",
142-
"@libp2p/interfaces": "^3.0.2",
142+
"@libp2p/interfaces": "^3.3.1",
143143
"@libp2p/logger": "^2.0.0",
144144
"@libp2p/peer-id": "^2.0.0",
145145
"any-signal": "^3.0.1",
146-
"err-code": "^3.0.1",
147146
"ipfs-core-types": "^0.14.0",
148147
"multiformats": "^11.0.0",
149148
"p-defer": "^4.0.0",

src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { logger } from '@libp2p/logger'
22
import { CID } from 'multiformats/cid'
33
import PQueue from 'p-queue'
44
import defer from 'p-defer'
5-
import errCode from 'err-code'
5+
import { CodeError } from '@libp2p/interfaces/errors'
66
import anySignal from 'any-signal'
77
import type { PeerId } from '@libp2p/interface-peer-id'
88
import type { AbortOptions } from 'ipfs-core-types/src/utils'
@@ -202,7 +202,7 @@ class DelegatedPeerRouting implements PeerRouting, Startable {
202202
log('findPeer finished: %p', id)
203203
}
204204

205-
throw errCode(new Error('Not found'), 'ERR_NOT_FOUND')
205+
throw new CodeError('Not found', 'ERR_NOT_FOUND')
206206
}
207207

208208
/**

0 commit comments

Comments
 (0)