changeset 2726:a86f494457c2

plugin OTR: catch and log potr.context.ErrorReceived instead of raising it.
author Goffi <goffi@goffi.org>
date Wed, 26 Dec 2018 17:18:52 +0100
parents d0466af33483
children 59ac9284dee8
files sat/plugins/plugin_sec_otr.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/sat/plugins/plugin_sec_otr.py	Wed Dec 26 14:37:13 2018 +0100
+++ b/sat/plugins/plugin_sec_otr.py	Wed Dec 26 17:18:52 2018 +0100
@@ -595,6 +595,12 @@
             feedback = msg
             client.feedback(from_jid, msg)
             raise failure.Failure(exceptions.CancelError(msg))
+        except potr.context.ErrorReceived as e:
+            msg = D_(u"WARNING: received OTR error message: {msg}".format(msg=e))
+            log.warning(msg)
+            feedback = msg
+            client.feedback(from_jid, msg)
+            raise failure.Failure(exceptions.CancelError(msg))
         except StopIteration:
             return data
         else: