diff options
| author | Damian Johnson <atagar@torproject.org> | 2017-11-28 11:34:48 -0800 |
|---|---|---|
| committer | Damian Johnson <atagar@torproject.org> | 2017-11-28 11:34:48 -0800 |
| commit | 5378d759ed53377fc48649e333073f032cedd974 (patch) | |
| tree | 7c8f0afb520a42b38b1cf26f1ffbaf6b48c05a33 | |
| parent | 933cc48ea2bd8ce0e7e1c3f3ab9535a28e31d57a (diff) | |
Errors when saving torrc caused stacktrace
Why was I catching an IOError here? Stem generally raises an OperationFailed,
and possibly others when there's a malformed response. Caught thanks to
Dbryrtfbcbhgf...
https://trac.torproject.org/projects/tor/ticket/24409
Traceback (most recent call last):
File "/usr/local/bin/nyx", line 11, in <module>
sys.exit(main())
...
File "/usr/local/lib/python3.5/dist-packages/nyx/__init__.py", line 243, in draw_loop
keybinding.handle(key)
File "/usr/local/lib/python3.5/dist-packages/nyx/panel/__init__.py", line 84, in handle
self._action()
File "/usr/local/lib/python3.5/dist-packages/nyx/panel/config.py", line 219, in _show_write_dialog
controller.save_conf()
File "/usr/local/lib/python3.5/dist-packages/stem/control.py", line 3220, in save_conf
raise stem.OperationFailed(response.code, response.message)
stem.OperationFailed: Unable to write configuration to disk.
| -rw-r--r-- | nyx/panel/config.py | 2 | ||||
| -rw-r--r-- | web/changelog/index.html | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/nyx/panel/config.py b/nyx/panel/config.py index 67ab218..0b2f1dc 100644 --- a/nyx/panel/config.py +++ b/nyx/panel/config.py @@ -218,7 +218,7 @@ 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 IOError as exc: + except stem.ControllerError as exc: show_message('Unable to save configuration (%s)' % exc.strerror, HIGHLIGHT, max_wait = 2) self.redraw() diff --git a/web/changelog/index.html b/web/changelog/index.html index c47869b..f622f04 100644 --- a/web/changelog/index.html +++ b/web/changelog/index.html @@ -76,7 +76,8 @@ <li><span class="component">Configuration Editor</span> <ul> - <li>New tor configuration options crashed nyx when shown (<b><a href="https://trac.torproject.org/projects/tor/ticket/24401">ticket</a></b>) + <li>New tor configuration options crashed nyx when shown (<b><a href="https://trac.torproject.org/projects/tor/ticket/24401">ticket</a></b>)</li> + <li>Errors when saving the configuration could result in a stacktrace (<b><a href="https://trac.torproject.org/projects/tor/ticket/24409">ticket</a></b>)</li> </ul> </li> </ul> |
