diff --git a/examples/echo_client.py b/examples/echo_client.py index ded07cd..9e07a43 100644 --- a/examples/echo_client.py +++ b/examples/echo_client.py @@ -125,6 +125,9 @@ class EchoBot(ClientXMPP): # resolve. At this point you should have seen other exceptions # and given a chance to resolve them already. await self.plain_reply(msg, 'I was not able to decrypt the message.') + except (Exception,) as exn: + await self.plain_reply(msg, 'An error occured while attempting decryption.\n%r' % exn) + raise return None @@ -163,7 +166,11 @@ class EchoBot(ClientXMPP): # This is where you prompt your user to ask what to do. self['xep_0384'].trust(exn.bare_jid, exn.device, exn.ik) except Exception as exn: - break + await self.plain_reply( + original_msg, + 'An error occured while attempting to encrypt.\n%r' % exn, + ) + raise return None