Skip to content

Commit

Permalink
feat: print response_dict when name not found
Browse files Browse the repository at this point in the history
  • Loading branch information
hlf20010508 committed Jul 8, 2024
1 parent ae933c6 commit 96cbb85
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/handlers/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ async def transfer_handler(event):
await status_message.finish(
path=os.path.join(last_remote_root_path, name), size=event.file.size
)
except KeyError as e:
await event.reply(logger("Error: %s\nresponse: %s" % (e, response_dict)))
except Exception as e:
await event.reply("Error: %s" % logger(e))

Expand Down Expand Up @@ -118,6 +120,10 @@ async def transfer_handler(event):
path=os.path.join(last_remote_root_path, name),
size=message.file.size,
)
except KeyError as e:
await event.reply(
logger("Error: %s\nresponse: %s" % (e, response_dict))
)
except Exception as e:
await event.reply("Error: %s" % logger(e))
else:
Expand Down
2 changes: 2 additions & 0 deletions modules/handlers/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ async def url_handler(event):
path=os.path.join(last_remote_root_path, response_dict["name"]),
size=total_length,
)
except KeyError as e:
await event.reply(logger("Error: %s\nresponse: %s" % (e, response_dict)))
except Exception as e:
logger(e)
await status_message.report_error(e)
Expand Down

0 comments on commit 96cbb85

Please sign in to comment.