Commit 63dc98b0 authored by Maxime Buquet's avatar Maxime Buquet

example-bot: Add catchall except in decryption and encryption

Signed-off-by: Maxime Buquet's avatarMaxime “pep” Buquet <>
parent 9e70954a
......@@ -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)
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:
await self.plain_reply(
'An error occured while attempting to encrypt.\n%r' % exn,
return None
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment