Skip to content

Fix: missing try catch on aleph file upload #365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2025
Merged

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.

2 participants