Skip to content

Commit 984f13e

Browse files
authored
fix: update log messages (#2324)
Ensure the log messages make sense
1 parent ad6f70b commit 984f13e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/libp2p/src/upgrader.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,8 @@ export class DefaultUpgrader implements Upgrader {
641641
protocol
642642
}
643643
} catch (err: any) {
644-
throw new CodeError(String(err), codes.ERR_ENCRYPTION_FAILED)
644+
connection.log.error('encrypting inbound connection to %p failed', err)
645+
throw new CodeError(err.message, codes.ERR_ENCRYPTION_FAILED)
645646
}
646647
}
647648

@@ -677,7 +678,8 @@ export class DefaultUpgrader implements Upgrader {
677678
protocol
678679
}
679680
} catch (err: any) {
680-
throw new CodeError(String(err), codes.ERR_ENCRYPTION_FAILED)
681+
connection.log.error('encrypting outbound connection to %p failed', err)
682+
throw new CodeError(err.message, codes.ERR_ENCRYPTION_FAILED)
681683
}
682684
}
683685

0 commit comments

Comments
 (0)