From 9fd7f2196b123c45423ac7c476af142a7ebf685d Mon Sep 17 00:00:00 2001 From: Vitaliy Mysak Date: Fri, 12 Jul 2019 18:25:21 +0000 Subject: [PATCH] spdkcli: handle BrokenPipeError Catch BrokenPipeError to display meaningful error message. Withouth this change, user gets stacktrace when e.g. SPDK application was closed. Change-Id: Ia7d8edb92a70b4c4b9e71a7d4ce38e265769936a Signed-off-by: Vitaliy Mysak Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461571 Tested-by: SPDK CI Jenkins Reviewed-by: Karol Latecki Reviewed-by: Darek Stojaczyk Reviewed-by: Shuhei Matsumoto --- scripts/spdkcli.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/spdkcli.py b/scripts/spdkcli.py index 5a668c26b..6e2ccd0db 100755 --- a/scripts/spdkcli.py +++ b/scripts/spdkcli.py @@ -74,6 +74,9 @@ def main(): spdk_shell.run_interactive() except (JSONRPCException, ExecutionError) as e: spdk_shell.log.error("%s" % e) + except BrokenPipeError as e: + spdk_shell.log.error("Lost connection with SPDK: %s" % e) + break if __name__ == "__main__":