Skip to content
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

Improved error handling in torrent info endpoint #7975

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

drew2a
Copy link
Collaborator

@drew2a drew2a commented Apr 17, 2024

Updated the TorrentInfoEndpoint class to catch OSError, which includes FileNotFoundError and PermissionError, while decoding a torrent file. This ensures that the server responds with an appropriate 500 error message when such issues occur.

Fixes #7974

@drew2a drew2a marked this pull request as ready for review April 17, 2024 14:49
@drew2a drew2a requested a review from a team as a code owner April 17, 2024 14:49
@drew2a drew2a requested review from xoriole and removed request for a team April 17, 2024 14:49
Added a test case to handle PermissionError when loading a torrent file from disk. Updated the TorrentInfoEndpoint class to catch OSError, which includes FileNotFoundError and PermissionError, while decoding a torrent file. This ensures that the server responds with an appropriate 500 error message when such issues occur.
@drew2a drew2a merged commit 8d59f73 into Tribler:main Apr 19, 2024
20 checks passed
@drew2a drew2a deleted the fix/7974 branch April 19, 2024 09:35
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.

[7.13.3] PermissionError: [Errno 13] Permission denied: <filepath>
2 participants