From 7431807c2560eeecf0903575783c0f9b85ef4224 Mon Sep 17 00:00:00 2001 From: Michel Hidalgo Date: Mon, 21 Oct 2019 17:46:03 -0300 Subject: [PATCH] Make interface show fail gracefully (no traceback). Signed-off-by: Michel Hidalgo --- ros2interface/ros2interface/verb/show.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ros2interface/ros2interface/verb/show.py b/ros2interface/ros2interface/verb/show.py index a576151c0..b65c188ea 100644 --- a/ros2interface/ros2interface/verb/show.py +++ b/ros2interface/ros2interface/verb/show.py @@ -27,6 +27,9 @@ def add_arguments(self, parser, cli_name): arg.completer = type_completer def main(self, *, args): - file_path = get_interface_path(args.type) + try: + file_path = get_interface_path(args.type) + except LookupError as e: + return str(e) with open(file_path, 'r', encoding='utf-8') as h: print(h.read().rstrip())