From 6fa5dd781aed59abf14d2c7b3dc7ab5ac8763d94 Mon Sep 17 00:00:00 2001 From: achingbrain Date: Mon, 18 Dec 2023 17:52:56 +0000 Subject: [PATCH] fix: update log messages Ensure the log messages make sense --- packages/libp2p/src/upgrader.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/libp2p/src/upgrader.ts b/packages/libp2p/src/upgrader.ts index 0c15295af3..fa514232f0 100644 --- a/packages/libp2p/src/upgrader.ts +++ b/packages/libp2p/src/upgrader.ts @@ -641,7 +641,8 @@ export class DefaultUpgrader implements Upgrader { protocol } } catch (err: any) { - throw new CodeError(String(err), codes.ERR_ENCRYPTION_FAILED) + connection.log.error('encrypting inbound connection to %p failed', err) + throw new CodeError(err.message, codes.ERR_ENCRYPTION_FAILED) } } @@ -677,7 +678,8 @@ export class DefaultUpgrader implements Upgrader { protocol } } catch (err: any) { - throw new CodeError(String(err), codes.ERR_ENCRYPTION_FAILED) + connection.log.error('encrypting outbound connection to %p failed', err) + throw new CodeError(err.message, codes.ERR_ENCRYPTION_FAILED) } }