From 571c623635122342765bcddc3ea2497a71d4681a Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Fri, 17 May 2024 17:57:22 +0100 Subject: [PATCH 1/2] 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) } } From d18026a4081f1c2ff7766c7394a395346abbc70a Mon Sep 17 00:00:00 2001 From: achingbrain Date: Fri, 17 May 2024 18:32:31 +0100 Subject: [PATCH 2/2] chore: remove undefined var --- packages/libp2p/src/upgrader.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/libp2p/src/upgrader.ts b/packages/libp2p/src/upgrader.ts index 6a0645b354..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', remotePeerId, err) + connection.log.error('encrypting inbound connection failed', err) throw new CodeError(err.message, codes.ERR_ENCRYPTION_FAILED) } }