[AutoAdd] Fixed error dialog not being shown on error

This happened due to the removal of `exception_msg` attribute, which was
removed with the changes to `RPC` protocol in commit 9b812a4.
Now we access the message using the `message` attribute.

Closes: deluge-torrent/deluge#332
Closes: https://dev.deluge-torrent.org/ticket/3069
This commit is contained in:
DjLegolas 2022-01-04 22:10:00 +02:00 committed by Calum Lind
parent fca08cf583
commit 4f0c786649
No known key found for this signature in database
GPG key ID: 90597A687B836BA3
2 changed files with 2 additions and 7 deletions

View file

@ -324,7 +324,7 @@ class OptionsDialog:
dialogs.ErrorDialog(_('Incompatible Option'), str(ex), self.dialog).run()
def on_error_show(self, result):
d = dialogs.ErrorDialog(_('Error'), result.value.exception_msg, self.dialog)
d = dialogs.ErrorDialog(_('Error'), result.value.message, self.dialog)
result.cleanFailure()
d.run()

View file

@ -58,13 +58,8 @@ class Command(BaseCommand):
return component.start()
def on_connect_fail(result):
try:
msg = result.value.exception_msg
except AttributeError:
msg = result.value.message
self.console.write(
'{!error!}Failed to connect to %s:%s with reason: %s'
% (host, port, msg)
f'{{!error!}}Failed to connect to {host}:{port} with reason: {result.value.message}'
)
return result