From f0f036939cc0ca4cc87c68f4e6c4d9473c9a2008 Mon Sep 17 00:00:00 2001 From: amanusk Date: Mon, 27 Aug 2018 21:53:12 +0300 Subject: [PATCH] Refix bug #50, crash on multiple esc --- s_tui/HelperFunctions.py | 2 +- s_tui/s_tui.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/s_tui/HelperFunctions.py b/s_tui/HelperFunctions.py index af98d82..cecf56d 100644 --- a/s_tui/HelperFunctions.py +++ b/s_tui/HelperFunctions.py @@ -31,7 +31,7 @@ from collections import OrderedDict from sys import exit -__version__ = "0.8.1" +__version__ = "0.8.2" def get_processor_name(): diff --git a/s_tui/s_tui.py b/s_tui/s_tui.py index 1f09eda..2720429 100755 --- a/s_tui/s_tui.py +++ b/s_tui/s_tui.py @@ -759,15 +759,21 @@ def main(self): try: self.loop.run() except (ZeroDivisionError) as e: + # In case of Zero division, we want an error to return, and + # get a clue where this happens logging.debug("Some stat caused divide by zero exception. Exiting") logging.error(e, exc_info=True) print(ERROR_MESSAGE) except (AttributeError) as e: + # In this case we restart the loop, to address bug #50, where + # urwid crashes on multiple presses on 'esc' logging.debug("Catch attribute Error in urwid and restart") logging.debug(e, exc_info=True) self.main() except (psutil.NoSuchProcess) as e: - logging.error("No such proccess error") + # This might happen if the stress process is not found, in this + # case, we want to know why + logging.error("No such process error") logging.error(e, exc_info=True) print(ERROR_MESSAGE)