mirror of
https://github.com/rembo10/headphones.git
synced 2026-07-21 08:24:00 +01:00
More exception handling for torrent removal
This commit is contained in:
@@ -261,7 +261,11 @@ def removeTorrent(torrentid, remove_data=False):
|
|||||||
response = requests.post(delugeweb_url, data=post_data.encode('utf-8'), cookies=delugeweb_auth,
|
response = requests.post(delugeweb_url, data=post_data.encode('utf-8'), cookies=delugeweb_auth,
|
||||||
verify=deluge_verify_cert, headers=headers)
|
verify=deluge_verify_cert, headers=headers)
|
||||||
|
|
||||||
state = json.loads(response.text)['result']['state']
|
try:
|
||||||
|
state = json.loads(response.text)['result']['state']
|
||||||
|
except KeyError as e:
|
||||||
|
logger.debug('Deluge: "state" KeyError when trying to remove torrent %s' % str(torrentid))
|
||||||
|
return False
|
||||||
|
|
||||||
not_finished = ["queued", "seeding", "downloading", "checking", "error"]
|
not_finished = ["queued", "seeding", "downloading", "checking", "error"]
|
||||||
result = False
|
result = False
|
||||||
|
|||||||
Reference in New Issue
Block a user