Skip to content

Commit

Permalink
fix: log error correctly (#2552)
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 48444f7 commit a3e8bea
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 failed', 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 a3e8bea

Please sign in to comment.