Skip to content

Commit

Permalink
Raise ValueError for yaml parse error
Browse files Browse the repository at this point in the history
  • Loading branch information
wkentaro committed May 25, 2017
1 parent 6e3e0b0 commit 412d56e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/roslaunch/src/roslaunch/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_)

Expand Down

0 comments on commit 412d56e

Please sign in to comment.