Use .name instead of .code for errors

Fix for the change in libp2p here: https://github.com/libp2p/js-libp2p/pull/2655
This commit is contained in:
Julien Malard-Adam 2025-02-04 12:09:11 -05:00 committed by GitHub
parent d290032ebf
commit 41f015cb13
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -196,7 +196,7 @@ const Sync = async ({ ipfs, log, events, onSynced, start, timeout }) => {
} catch (e) {
console.error(e)
peers.delete(peerId)
if (e.code === 'ERR_UNSUPPORTED_PROTOCOL') {
if (e.name === 'ERR_UNSUPPORTED_PROTOCOL') {
// Skip peer, they don't have this database currently
} else {
events.emit('error', e)