Skip to content

Commit

Permalink
Refix bug #50, crash on multiple esc
Browse files Browse the repository at this point in the history
  • Loading branch information
amanusk committed Aug 27, 2018
1 parent 867e767 commit 6a0997c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion s_tui/s_tui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 6a0997c

Please sign in to comment.