Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[roslaunch] raise ArgException in _arg_tag to avoid unexpected error in roslaunch.config.load_config_default #2371

Open
wants to merge 2 commits into
base: noetic-devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tools/roslaunch/src/roslaunch/xmlloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ def _arg_tag(self, tag, context, ros_config, verbose=True):

context.add_arg(name, value=value, default=default, doc=doc)

except substitution_args.ArgException as e:
raise XmlParseException(
except ArgException as e:
raise ArgException(
"arg '%s' is not defined. \n\nArg xml is %s"%(e, tag.toxml()))
except ResourceNotFound as e:
raise ResourceNotFound(
Expand Down
5 changes: 5 additions & 0 deletions tools/roslaunch/test/unit/test_roslaunch_rlutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,8 @@ def test_check_roslaunch(self):
filename = os.path.join(get_test_path(), 'test', 'xml', 'test-ignore-unset-args.launch')
error_msg = roslaunch.rlutil.check_roslaunch(filename, ignore_unset_args=True)
assert error_msg is None

def test_check_roslaunch_arg_in_arg(self):
filename = os.path.join(get_test_path(), 'test', 'xml', 'test-ignore-unset-args-arg-in-arg.launch')
error_msg = roslaunch.rlutil.check_roslaunch(filename, ignore_unset_args=True)
assert error_msg is None
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<launch>
<arg name="foo1" /> <!-- no `default="something" here! -->
<arg name="foo2" value="$(arg foo1)"/>
<node name="bar" pkg="bar" type="bar">
<param name="foo" value="$(arg foo2k)" />
</node>
</launch>