From 6b54af08422013e4b97403deaca7cbeb52199502 Mon Sep 17 00:00:00 2001 From: Nick Mills-Barrett Date: Mon, 25 Mar 2024 13:23:01 +0000 Subject: [PATCH] Fix --- .../portal_util/message_convert.py | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/mautrix_telegram/portal_util/message_convert.py b/mautrix_telegram/portal_util/message_convert.py index ac19c92b..0bf89bbc 100644 --- a/mautrix_telegram/portal_util/message_convert.py +++ b/mautrix_telegram/portal_util/message_convert.py @@ -534,15 +534,18 @@ async def _convert_document_thumb_only( thumb_loc = None thumb_size = None if thumb_loc: - file = await util.transfer_thumbnail_to_matrix( - client, - intent, - thumb_loc, - video=None, - mime_type=document.mime_type, - encrypt=self.portal.encrypted, - async_upload=self.config["homeserver.async_media"], - ) + try: + file = await util.transfer_thumbnail_to_matrix( + client, + intent, + thumb_loc, + video=None, + mime_type=document.mime_type, + encrypt=self.portal.encrypted, + async_upload=self.config["homeserver.async_media"], + ) + except Exception: + self.log.exception("Failed to transfer thumbnail") if not file: name = attrs.name or "" caption = f"\n{evt.message}" if evt.message else ""