Skip to content

Commit

Permalink
Merge pull request #1150 from pipermerriam/piper/handle-decryption-error
Browse files Browse the repository at this point in the history
Handle decryption error
  • Loading branch information
pipermerriam authored Aug 8, 2018
2 parents cde9693 + 0024060 commit 269efb7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions p2p/peer.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,16 @@ async def _run(self) -> None:
while True:
try:
cmd, msg = await self.read_msg()
except (PeerConnectionLost, TimeoutError) as e:
except (PeerConnectionLost, TimeoutError) as err:
self.logger.debug(
"%s stopped responding (%s), disconnecting", self.remote, repr(e))
"%s stopped responding (%r), disconnecting", self.remote, err)
return
except DecryptionError as err:
self.logger.warn(
"Unable to decrypt message from %s, disconnecting: %r",
self, err,
exc_info=True,
)
return

try:
Expand Down

0 comments on commit 269efb7

Please sign in to comment.