Add throwing parameter name if parameter is not set (#833)
* added throwing parameter name if parameter is not set Signed-off-by: Alex <cvbn127@gmail.com> Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com>
This commit is contained in:
parent
925460dcfb
commit
64c0f86f14
1 changed files with 5 additions and 1 deletions
|
@ -271,7 +271,11 @@ public:
|
||||||
{
|
{
|
||||||
return get_parameter_impl(
|
return get_parameter_impl(
|
||||||
parameter_name,
|
parameter_name,
|
||||||
std::function<T()>([]() -> T {throw std::runtime_error("Parameter not set");}));
|
std::function<T()>([¶meter_name]() -> T
|
||||||
|
{
|
||||||
|
throw std::runtime_error("Parameter '" + parameter_name + "' is not set");
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
RCLCPP_PUBLIC
|
RCLCPP_PUBLIC
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue