fix in handling exceptions in cmds

This commit is contained in:
Wolfgang Hottgenroth 2019-07-18 14:02:50 +01:00
parent d8ce7c8bc2
commit 84f4ecf5a1

View File

@ -33,9 +33,11 @@ class CmdInterpreter(cmd.Cmd):
def onecmd(self, line):
try:
return self.onecmd(line)
return super().onecmd(line)
except Exception as e:
msg = 'Caught exception in cmd "{0}": {1!s}'.format(line, e)
self.__println(msg)
self.logger.error(msg)
def __print(self, text):
self.stdout.write(text)