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

Handle errors that may occur during thumbnail deletion #16

Open
daniil-berg opened this issue Sep 13, 2024 · 0 comments
Open

Handle errors that may occur during thumbnail deletion #16

daniil-berg opened this issue Sep 13, 2024 · 0 comments
Assignees
Labels
consistency An inconsistency that should be (re-)aligned error handling More helpful and transparent error handling/logging

Comments

@daniil-berg
Copy link
Contributor

We already catch and log any OSError during video file deletion in the StorageFileController.remove_files method:

await self.remove_thumbnails(file_hash)
try:
await self.remove_video(file)
except OSError as e:
log.error(f"Unexpected failure to delete video {file}: {e!r}")
continue

However the .remove_thumbnails method currently simply swallows any errors that may occur, when Path.unlink is called on a thumbnail path. Since gather already collects exceptions, we should simply log them there.

@daniil-berg daniil-berg self-assigned this Sep 13, 2024
@daniil-berg daniil-berg added consistency An inconsistency that should be (re-)aligned error handling More helpful and transparent error handling/logging labels Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consistency An inconsistency that should be (re-)aligned error handling More helpful and transparent error handling/logging
Projects
None yet
Development

No branches or pull requests

1 participant