Skip to content

Commit

Permalink
fix: log error correctly
Browse files Browse the repository at this point in the history
The peer id was meant to be passed to the format string with the error afterwards.
  • Loading branch information
achingbrain authored May 17, 2024
1 parent 8214dcf commit 571c623
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/libp2p/src/upgrader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 571c623

Please sign in to comment.