From a3e8beabdc2b551594952b5d5621555296eff79a Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Fri, 17 May 2024 20:04:00 +0100 Subject: [PATCH] fix: log error correctly (#2552) The peer id was meant to be passed to the format string with the error afterwards. --- packages/libp2p/src/upgrader.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/libp2p/src/upgrader.ts b/packages/libp2p/src/upgrader.ts index 8ae4b566e6..ac4efe74ba 100644 --- a/packages/libp2p/src/upgrader.ts +++ b/packages/libp2p/src/upgrader.ts @@ -641,7 +641,7 @@ export class DefaultUpgrader implements Upgrader { protocol } } catch (err: any) { - connection.log.error('encrypting inbound connection to %p failed', err) + connection.log.error('encrypting inbound connection failed', err) throw new CodeError(err.message, codes.ERR_ENCRYPTION_FAILED) } } @@ -678,7 +678,7 @@ export class DefaultUpgrader implements Upgrader { protocol } } catch (err: any) { - connection.log.error('encrypting outbound connection to %p failed', err) + connection.log.error('encrypting outbound connection to %p failed', remotePeerId, err) throw new CodeError(err.message, codes.ERR_ENCRYPTION_FAILED) } }