Skip to content

Commit 41f015c

Browse files
authored
Use .name instead of .code for errors
Fix for the change in libp2p here: libp2p/js-libp2p#2655
1 parent d290032 commit 41f015c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/sync.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ const Sync = async ({ ipfs, log, events, onSynced, start, timeout }) => {
196196
} catch (e) {
197197
console.error(e)
198198
peers.delete(peerId)
199-
if (e.code === 'ERR_UNSUPPORTED_PROTOCOL') {
199+
if (e.name === 'ERR_UNSUPPORTED_PROTOCOL') {
200200
// Skip peer, they don't have this database currently
201201
} else {
202202
events.emit('error', e)

0 commit comments

Comments
 (0)