From 412d56ef17c1ff5ddb65cbee00025623ddc34ce9 Mon Sep 17 00:00:00 2001 From: Kentaro Wada Date: Thu, 25 May 2017 17:47:05 +0900 Subject: [PATCH] Raise ValueError for yaml parse error --- tools/roslaunch/src/roslaunch/loader.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/roslaunch/src/roslaunch/loader.py b/tools/roslaunch/src/roslaunch/loader.py index 0724b8e56a..960105b665 100644 --- a/tools/roslaunch/src/roslaunch/loader.py +++ b/tools/roslaunch/src/roslaunch/loader.py @@ -96,7 +96,10 @@ def convert_value(value, type_): return False raise ValueError("%s is not a '%s' type"%(value, type_)) elif type_ == 'yaml': - return yaml.load(value) + try: + return yaml.load(value) + except yaml.parser.ParserError as e: + raise ValueError(e) else: raise ValueError("Unknown type '%s'"%type_)