Skip to content

change throw_from_rcl_error to throw from_rcl_error #647

@sloretz

Description

@sloretz

Feature request

Currently rclcpp has a function to throw an exception based on an rcl error.

rclcpp::exceptions::throw_from_rcl_error(ret, "Failed to add time jump callback");

This is a request to change that function to return an exception without throwing.

throw rclcpp::exceptions::from_rcl_error(ret, "Failed to add time jump callback");

I think this could help static analysis tools like cppcheck recognize when code won't be executed due to an exception. This would remove the need for #646

Implementation considerations

throw_from_rcl_error could be refactored to use from_rcl_error rather than changing all the code at once.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions