Skip to content

Commit

Permalink
fix: Pass exceptions when download result cannot be removed
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Feb 26, 2019
1 parent 0c4d141 commit 9a7659e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/aria2p/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@
# TODO: write aria2, aria2c, Aria2, Aria2c consistently
# TODO: write Torrent, torrent, Metalink, metalink, BitTorrent... consistently
# TODO: write all docstrings
# TODO: use proper logging messages (esp. in except: pass)
10 changes: 8 additions & 2 deletions src/aria2p/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,15 @@ def remove(self, downloads, force=False):
result.append(e)
else:
result.append(True)
self.client.remove_download_result(download.gid)
try:
self.client.remove_download_result(download.gid)
except ClientException:
pass
if removed_gid != download.gid:
self.client.remove_download_result(removed_gid)
try:
self.client.remove_download_result(removed_gid)
except ClientException:
pass

return result

Expand Down

0 comments on commit 9a7659e

Please sign in to comment.