Commit bbe041fd authored by louiz’'s avatar louiz’
Browse files

Catch CorrectionError to avoid tracebacking when /correct fails

parent ad04d32b
......@@ -495,7 +495,11 @@ class ChatTab(Tab):
def modify_message(self, txt, old_id, new_id, user=None):
self.log_message(txt, time, self.name)
try:
message = self._text_buffer.modify_message(txt, old_id, new_id, time=time, user=user)
except CorrectionError as e:
self.core.information("%s" % (e,), 'Error')
else:
if message:
self.text_win.modify_message(old_id, message)
self.core.refresh_window()
......@@ -1765,7 +1769,11 @@ class MucTab(ChatTab):
def modify_message(self, txt, old_id, new_id, time=None, nickname=None, user=None):
self.log_message(txt, time, nickname)
highlight = self.do_highlight(txt, time, nickname)
try:
message = self._text_buffer.modify_message(txt, old_id, new_id, highlight=highlight, time=time, user=user)
except CorrectionError as e:
self.core.information("%s" % (e,), 'Error')
else:
if message:
self.text_win.modify_message(old_id, message)
self.core.refresh_window()
......
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