From 571c623635122342765bcddc3ea2497a71d4681a Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Fri, 17 May 2024 17:57:22 +0100 Subject: [PATCH] fix: log error correctly 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..6a0645b354 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 to %p failed', remotePeerId, 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) } }