From 747236ae8bb3871beeec674d5154c8b28d0ca22d Mon Sep 17 00:00:00 2001 From: liamcottle Date: Mon, 28 Jul 2025 17:23:03 +1200 Subject: [PATCH] add try catch for fallback file download parsing, so client can show as unsupported --- meshchat.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/meshchat.py b/meshchat.py index a970e7e..e7470d7 100644 --- a/meshchat.py +++ b/meshchat.py @@ -3568,12 +3568,15 @@ class NomadnetFileDownloader(NomadnetDownloader): self.on_file_download_success(file_name, file_data) return - # original response format + # try using original response format # unsure if this is actually used anymore now that a buffered reader is provided # have left here just in case... - file_name: str = response[0] - file_data: bytes = response[1] - self.on_file_download_success(file_name, file_data) + try: + file_name: str = response[0] + file_data: bytes = response[1] + self.on_file_download_success(file_name, file_data) + except: + self.on_download_failure("unsupported_response") # page download failed, send error to provided callback def on_download_failure(self, failure_reason):