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
Improve launch file parsing error messages #626
Conversation
347cd07
to
07da9df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small comment, but otherwise this looks good to me with green CI.
launch_xml/launch_xml/entity.py
Outdated
@@ -91,7 +91,7 @@ def get_attr( | |||
If coercion fails, `ValueError` will be raised. | |||
""" | |||
attr_error = AttributeError( | |||
'Attribute {} of type {} not found in Entity {}'.format( | |||
'Attribute `{}` of type `{}` not found in Entity `{}`'.format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Attribute `{}` of type `{}` not found in Entity `{}`'.format( | |
"Attribute '{}' of type '{}' not found in Entity '{}'".format( |
I would prefer using single quotes ('
) instead of ticks, like here:
launch/launch/launch/event_handler.py
Line 83 in cb39d92
"{}(matcher='{}', handler='{}', handle_once={})".format( |
The same goes for the other locations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, I also prefer them. I just did it like the other error messages in the same file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you're right. I believe when I made the comment I looked elsewhere in the repository and saw the single quotes in use. It'd be nice to have this more consistent within and across files.
@ros-pull-request-builder retest this please |
@audrow friendly ping |
@audrow ping |
d4869dc
to
595ff68
Compare
Signed-off-by: Timon Engelke <timon.engelke@online.de>
Signed-off-by: Timon Engelke <timon.engelke@online.de>
Co-authored-by: Chris Lalancette <clalancette@gmail.com> Signed-off-by: Timon Engelke <timon.engelke@online.de>
595ff68
to
2af2fb4
Compare
Signed-off-by: Chris Lalancette <clalancette@gmail.com>
* Improve launch file parsing error messages Signed-off-by: Timon Engelke <timon.engelke@online.de> Co-authored-by: Chris Lalancette <clalancette@gmail.com>
Backport of ros2#626: * Parser errors clearly show that values are substituted and not part of the error message itself. * On an InvalidLaunchFileError, all parsing errors are logged. Signed-off-by: David Yackzan <dwyackzan@gmail.com>
* Improve launch file parsing error messages Backport of #626: * Parser errors clearly show that values are substituted and not part of the error message itself. * On an InvalidLaunchFileError, all parsing errors are logged. * Add exception type to error output Backport of #753: * Output exception type for InvalidLaunchFileErrors * Add test checking for exception type in output Signed-off-by: David Yackzan <dwyackzan@gmail.com>
This pull request improves the parsing error messages for launch files in two ways:
Attribute value of type <class 'str'> not found in Entity let
, not realizing that the attribute "value" was missing and not some kind of "attribute value".