From: Christoph Hellwig Date: Fri, 25 Mar 2016 13:59:01 +0000 (+0100) Subject: nvmetcli: improve error reporting X-Git-Tag: v0.2~28 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=7aace5d2aad368afd5b4c6bdc24520623bb0a186;p=users%2Fhch%2Fnvmetcli.git nvmetcli: improve error reporting Report a nice error message in red instead of a python backtrace. Signed-off-by: Christoph Hellwig --- diff --git a/nvmetcli b/nvmetcli index 95b36c9..fa2623b 100755 --- a/nvmetcli +++ b/nvmetcli @@ -229,13 +229,17 @@ def main(): funcs[sys.argv[1]](savefile) return - shell = configshell.shell.ConfigShell('~/.nvmetcli') - UIRootNode(shell) + try: + shell = configshell.shell.ConfigShell('~/.nvmetcli') + UIRootNode(shell) + except Exception as msg: + shell.log.error(str(msg)) + return while not shell._exit: try: shell.run_interactive() - except configshell.ExecutionError as msg: + except Exception as msg: shell.log.error(str(msg)) if __name__ == "__main__":