Skip to content

ParameterNotDeclaredExceptions are silently discarded in set-parameters-callback #1794

@fritschem

Description

@fritschem

Generated by Generative AI

No response

Operating System:

Linux XXX 6.14.0-1006-oem #6-Ubuntu SMP PREEMPT_DYNAMIC Mon Jun 23 09:59:41 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

ROS version or commit hash:

jazzy

RMW implementation (if applicable):

No response

RMW Configuration (if applicable):

No response

Client library (if applicable):

rclcpp

'ros2 doctor --report' output

Steps to reproduce issue

  1. Create a parameter callback function which throws a ParameterNotDeclaredException
  2. Register it with add_post_set_parameters_callback
  3. Trigger it by changing a parameter

Expected behavior

Abort with an exception, some output, anything

Actual behavior

Nothing

Additional information

In rclcpp/rclcpp/src/rclcpp/parameter_service.cpp the created services catch ParameterNotDeclaredExceptions and make a DEBUG output. As the services also call the registered callbacks, the exception from the callbacks is caught, too. So when you do a get_parameter("parametername") inside your callback and misspell the parameter name, the callback is aborted silently, because DEBUG output is normally not shown. This is in stark contrast to the abort that happens when you do it outside a parameter callback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions