Tribler / tribler

Privacy enhanced BitTorrent client with P2P content discovery
https://www.tribler.org
GNU General Public License v3.0
4.8k stars 444 forks source link

Add error handling for version history file loading #7983

Closed drew2a closed 5 months ago

drew2a commented 5 months ago

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