From c80ca295c66b3c89fe4361633998e1363f1de80b Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Tue, 6 Aug 2019 08:41:46 -0500 Subject: [PATCH] Attempted to collect more data in incorrect attachment parsing --- src/controller/buffers.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/controller/buffers.py b/src/controller/buffers.py index ac3fbc2..d811fba 100644 --- a/src/controller/buffers.py +++ b/src/controller/buffers.py @@ -79,7 +79,10 @@ class baseBuffer(object): def insert(self, item, reversed=False): """ Add a new item to the list. Uses renderers.composefunc for parsing the dictionary and create a valid result for putting it in the list.""" - item_ = getattr(renderers, self.compose_function)(item, self.session) + try: + item_ = getattr(renderers, self.compose_function)(item, self.session) + except: + log.exception(item) wx.CallAfter(self.tab.list.insert_item, reversed, *item_) def get_items(self, show_nextpage=False): @@ -1261,7 +1264,11 @@ class chatBuffer(baseBuffer): # We don't need the photos_list attachment, so skip it. if i["type"] == "photos_list": continue - attachments.append(add_attachment(i)) + try: + rendered_object = add_attachment(i) + except: + log.exception("Error parsing the following attachment on chat: %r" % (i,)) + attachments.append(rendered_object) self.attachments.append(i) self.tab.attachments.list.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.open_attachment) self.tab.insert_attachments(attachments)