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

Add error handling for version history file loading #7983

Merged
merged 1 commit into from
Apr 22, 2024

Conversation

drew2a
Copy link
Contributor

@drew2a drew2a commented Apr 18, 2024

Introduced exception handling to manage potential errors during the loading of the version history file. If a VersionError is encountered, it logs a warning and attempts to remove the corrupted version file. In case of an OSError during this removal process, another warning is logged. Additionally, JSONDecodeError is now caught when attempting to load JSON from the file content, raising a VersionError if such an issue occurs. This improves robustness against corrupted or improperly formatted version history files.

Fixes #7920

@drew2a drew2a force-pushed the fix/7920 branch 3 times, most recently from 9575b8f to 42e7187 Compare April 19, 2024 10:50
@drew2a drew2a marked this pull request as ready for review April 19, 2024 10:57
@drew2a drew2a requested review from a team and xoriole and removed request for a team April 19, 2024 10:57
Introduced exception handling to manage potential errors during the loading of the version history file. If a VersionError is encountered, it logs a warning and attempts to remove the corrupted version file. In case of an OSError during this removal process, another warning is logged. Additionally, JSONDecodeError is now caught when attempting to load JSON from the file content, raising a VersionError if such an issue occurs. This improves robustness against corrupted or improperly formatted version history files.
@drew2a drew2a merged commit 676731e into Tribler:main Apr 22, 2024
20 checks passed
@drew2a drew2a deleted the fix/7920 branch April 22, 2024 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Json error
2 participants