Skip to content

Get error string from rcl layer #164

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

Merged
merged 1 commit into from
May 16, 2022
Merged

Get error string from rcl layer #164

merged 1 commit into from
May 16, 2022

Conversation

nnmm
Copy link
Contributor

@nnmm nnmm commented May 13, 2022

Storing the error string requires a new struct, which I've named RclrsError.

This also makes Display impls use a period instead of an exclamation mark.

Closes #111

@nnmm nnmm requested review from jhdcs and esteve May 13, 2022 22:04
@nnmm
Copy link
Contributor Author

nnmm commented May 13, 2022

As an example (I added .context("Failed to create context") and .context("Failed to do awesome thing") in appropriate places in the minimal subscriber, so the chain is longer than just two entries):

cargo run --bin minimal_subscriber -- --ros-args -p plem
   Compiling rclrs_examples v0.2.0 (/home/user/workspace/src/ros2_rust/rclrs_examples)
    Finished dev [unoptimized + debuginfo] target(s) in 2.72s
     Running `target/debug/minimal_subscriber --ros-args -p plem`
[ERROR] [1652473951.278531464] [rcl]: Failed to parse global arguments
Error: Failed to do awesome thing

Caused by:
    0: Failed to create context
    1: RclReturnCode::ParsingError: Found invalid ROS argument while parsing.
    2: Couldn't parse parameter override rule: '-p plem'. Error: Expected lexeme type (22) not found, search ended at index 4, at /tmp/binarydeb/ros-galactic-rcl-3.1.2/src/rcl/lexer_lookahead.c:233

2 is the error string from the rcl layer.

@nnmm nnmm merged commit 744aa91 into master May 16, 2022
@nnmm nnmm deleted the rclrs_error branch May 16, 2022 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Get error messages from rcl layer
3 participants