commit 8565384dc42b3f0faef027f890602b15513787be Author: Rémi Oudin oudin@crans.org Date: Wed Mar 14 10:54:11 2018 +0100
ControllerError has no strerror attribute.
Moreover, a more accurate handling of exceptions is performed. --- nyx/panel/config.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/nyx/panel/config.py b/nyx/panel/config.py index af899b1..372ca66 100644 --- a/nyx/panel/config.py +++ b/nyx/panel/config.py @@ -218,8 +218,10 @@ class ConfigPanel(nyx.panel.Panel): try: controller.save_conf() show_message('Saved configuration to %s' % controller.get_info('config-file', '<unknown>'), HIGHLIGHT, max_wait = 2) + except stem.OperationFailed as exc: + show_message('Unable to save configuration ([%s] %s)' % (exc.code, exc.message), HIGHLIGHT, max_wait = 2) except stem.ControllerError as exc: - show_message('Unable to save configuration (%s)' % exc.strerror, HIGHLIGHT, max_wait = 2) + show_message('Unable to save configuration (%s)' % exc, HIGHLIGHT, max_wait = 2)
self.redraw()
tor-commits@lists.torproject.org