mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-03-30 15:08:28 +00:00
Merge pull request #1216 from julienmalard/patch-1
Use `.name` instead of `.code` for errors
This commit is contained in:
commit
3d41ab5d99
@ -194,9 +194,8 @@ const Sync = async ({ ipfs, log, events, onSynced, start, timeout }) => {
|
||||
const stream = await libp2p.dialProtocol(remotePeer, headsSyncAddress, { signal })
|
||||
await pipe(sendHeads, stream, receiveHeads(peerId))
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
peers.delete(peerId)
|
||||
if (e.code === 'ERR_UNSUPPORTED_PROTOCOL') {
|
||||
if (e.name === 'UnsupportedProtocolError') {
|
||||
// Skip peer, they don't have this database currently
|
||||
} else {
|
||||
events.emit('error', e)
|
||||
|
Loading…
x
Reference in New Issue
Block a user