mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 11:35:49 +00:00
[Console] Fix unhandled error in torrentactions
Fix calls to core pause and resume using the singular methods with a list of torrent ids. Fix and simplify the handling of errors from core.
This commit is contained in:
parent
c655da38c8
commit
c7567ddee4
1 changed files with 3 additions and 8 deletions
|
@ -33,12 +33,7 @@ torrent_options = [
|
|||
|
||||
|
||||
def action_error(error, mode):
|
||||
rerr = error.value
|
||||
mode.report_message(
|
||||
'An Error Occurred', '%s got error %s: %s' % (
|
||||
rerr.method, rerr.exception_type, rerr.exception_msg,
|
||||
),
|
||||
)
|
||||
mode.report_message('Error Occurred', error.getErrorMessage())
|
||||
mode.refresh()
|
||||
|
||||
|
||||
|
@ -172,11 +167,11 @@ def torrent_action(action, *args, **kwargs):
|
|||
|
||||
if action == ACTION.PAUSE:
|
||||
log.debug('Pausing torrents: %s', torrent_ids)
|
||||
client.core.pause_torrent(torrent_ids).addErrback(action_error, mode)
|
||||
client.core.pause_torrents(torrent_ids).addErrback(action_error, mode)
|
||||
retval = True
|
||||
elif action == ACTION.RESUME:
|
||||
log.debug('Resuming torrents: %s', torrent_ids)
|
||||
client.core.resume_torrent(torrent_ids).addErrback(action_error, mode)
|
||||
client.core.resume_torrents(torrent_ids).addErrback(action_error, mode)
|
||||
retval = True
|
||||
elif action == ACTION.QUEUE:
|
||||
queue_mode = QueueMode(mode, torrent_ids)
|
||||
|
|
Loading…
Add table
Reference in a new issue