[AutoAdd] Fixes #3515 - check for more torrent decode errors

https://github.com/deluge-torrent/deluge/pull/381 improved the situation
with possible errors during torrent decoding. However, the log message in
https://dev.deluge-torrent.org/ticket/3515 indicates a RuntimeError:

```
Traceback: <class 'RuntimeError'>: unexpected end of file in bencoded string
```

This commit adds RuntimeError to those caught while loading the torrent
to add.

Closes: https://github.com/deluge-torrent/deluge/pull/411
This commit is contained in:
Ryan Ernst 2023-02-11 22:06:36 -08:00 committed by Calum Lind
parent 2a945de069
commit fa750c9fd0
No known key found for this signature in database
GPG Key ID: 90597A687B836BA3
1 changed files with 1 additions and 1 deletions

View File

@ -271,7 +271,7 @@ class Core(CorePluginBase):
try: try:
filedump = self.load_torrent(filepath, magnet) filedump = self.load_torrent(filepath, magnet)
except (OSError, EOFError, InvalidTorrentError) as ex: except (OSError, EOFError, RuntimeError, InvalidTorrentError) as ex:
# If torrent is invalid, keep track of it so can try again on the next pass. # If torrent is invalid, keep track of it so can try again on the next pass.
# This catches torrent files that may not be fully saved to disk at load time. # This catches torrent files that may not be fully saved to disk at load time.
log.debug('Torrent is invalid: %s', ex) log.debug('Torrent is invalid: %s', ex)