[tor-commits] [nyx/master] ControllerError has no strerror attribute.

atagar at torproject.org atagar at torproject.org
Wed Mar 14 19:57:37 UTC 2018


commit 8565384dc42b3f0faef027f890602b15513787be
Author: RĂ©mi Oudin <oudin at 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()
 





More information about the tor-commits mailing list