Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@1yam
Copy link
Member

@1yam 1yam commented Apr 23, 2025

Self proofreading checklist

  • The new code clear, easy to read and well commented.
  • New code does not duplicate the functions of builtin or popular libraries.
  • An LLM was used to review the new code and look for simplifications.
  • New classes and functions contain docstrings explaining what they provide.
  • All new code is covered by relevant tests.

Changes

This pull request introduces error handling for the upload function in src/aleph_client/commands/files.py to provide more informative feedback when file uploads fail. It also includes a minor import statement update.

Error handling improvements:

  • Added a try-except block in the upload function to catch ClientResponseError exceptions during file uploads. This ensures that specific error messages are displayed to the user, such as notifying them when a file is too large to upload (status: 413) or providing a generic error message for other cases. [1] [2]

Import updates:

  • Imported ClientResponseError from aiohttp to support the new error handling in the upload function.

How to test

aleph file upload with file > than 100 MiB or with a wallet without balancec

@1yam 1yam requested a review from nesitor April 23, 2025 15:07
@aleph-im aleph-im deleted a comment from github-actions bot Apr 23, 2025
@nesitor nesitor merged commit 671ea0e into master Apr 23, 2025
13 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants