mirror of
https://github.com/liamcottle/reticulum-meshchat.git
synced 2026-04-27 16:10:32 +00:00
add try catch for fallback file download parsing, so client can show as unsupported
This commit is contained in:
parent
4e55006084
commit
747236ae8b
1 changed files with 7 additions and 4 deletions
11
meshchat.py
11
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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue