mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-06-23 14:01:35 +00:00
fix: catch pipe errors (#678)
* fix: catch pipe errors There were some pipe errors not being caught. This can result in unhandled exceptions being thrown * fix: catch pipe errors in identify push handler
This commit is contained in:
@ -17,7 +17,7 @@ const handshake = require('it-handshake')
|
||||
const { NONCE_LENGTH } = require('./key-generator')
|
||||
const debug = require('debug')
|
||||
const log = debug('libp2p:pnet')
|
||||
log.err = debug('libp2p:pnet:err')
|
||||
log.error = debug('libp2p:pnet:err')
|
||||
|
||||
/**
|
||||
* Takes a Private Shared Key (psk) and provides a `protect` method
|
||||
@ -69,7 +69,7 @@ class Protector {
|
||||
// Decrypt all inbound traffic
|
||||
createUnboxStream(remoteNonce, this.psk),
|
||||
external
|
||||
)
|
||||
).catch(log.error)
|
||||
|
||||
return internal
|
||||
}
|
||||
|
Reference in New Issue
Block a user