15 #ifndef RCLCPP__EXCEPTIONS__EXCEPTIONS_HPP_
16 #define RCLCPP__EXCEPTIONS__EXCEPTIONS_HPP_
22 #include "rcl/error_handling.h"
24 #include "rclcpp/visibility_control.hpp"
26 #include "rcpputils/join.hpp"
38 : std::runtime_error(
"node is invalid") {}
46 const char * name_type_,
48 const char * error_msg_,
49 size_t invalid_index_)
50 : std::invalid_argument(format_error(name_type_, name_, error_msg_, invalid_index_)),
51 name_type(name_type_), name(name_), error_msg(error_msg_), invalid_index(invalid_index_)
56 const char * name_type,
58 const char * error_msg,
59 size_t invalid_index);
61 const std::string name_type;
62 const std::string name;
63 const std::string error_msg;
64 const size_t invalid_index;
107 : std::runtime_error(
"This code is unimplemented.") {}
109 : std::runtime_error(msg) {}
112 typedef void (* reset_error_function_t)();
130 throw_from_rcl_error [[noreturn]] (
132 const std::string & prefix =
"",
133 const rcl_error_state_t * error_state =
nullptr,
134 reset_error_function_t reset_error = rcl_reset_error);
148 std::string formatted_message;
156 RCLError(
rcl_ret_t ret,
const rcl_error_state_t * error_state,
const std::string & prefix);
178 const rcl_error_state_t * error_state,
179 const std::string & prefix);
190 rcl_ret_t ret,
const rcl_error_state_t * error_state,
const std::string & prefix);
200 : std::runtime_error(
201 "found unknown ROS arguments: '" + rcpputils::join(unknown_ros_args_in,
"', '") +
"'"),
202 unknown_ros_args(unknown_ros_args_in)
206 const std::vector<std::string> unknown_ros_args;
214 : std::runtime_error(
"Unknown type: " + type) {}
222 : std::runtime_error(
"event is invalid") {}
230 : std::runtime_error(
"event already registered") {}
238 : std::runtime_error(
"cannot create: " + obj_type +
" , callback group not in node") {}
246 using std::runtime_error::runtime_error;
253 using std::runtime_error::runtime_error;
271 : std::runtime_error(
"parameter '" + name +
"' has invalid type: " + message)
288 : std::runtime_error(
"Statically typed parameter '" + name +
"' must be initialized.")
296 using std::runtime_error::runtime_error;
303 using std::runtime_error::runtime_error;
310 using std::runtime_error::runtime_error;
317 using std::runtime_error::runtime_error;
329 : std::runtime_error(
"parameter '" + name +
"' is not initialized")
337 using std::runtime_error::runtime_error;
344 using std::runtime_error::runtime_error;
Thrown when an unregistered rclcpp::Event is encountered where a registered one was expected.
Thrown when an invalid rclcpp::Event object or SharedPtr is encountered.
Thrown when a node namespace is invalid.
Thrown when a method is trying to use a node, but it is invalid.
Thrown when a node name is invalid.
Thrown if requested parameter type is invalid.
RCLCPP_PUBLIC InvalidParameterTypeException(const std::string &name, const std::string message)
Construct an instance.
Thrown if passed parameter value is invalid.
Thrown if passed parameters are inconsistent or invalid.
Thrown if the QoS overrides provided aren't valid.
Thrown when a service name is invalid.
Thrown when a topic name is invalid.
Thrown when a callback group is missing from the node, when it wants to utilize the group.
Thrown when a any kind of name (node, namespace, topic, etc.) is invalid.
Thrown if parameter is already declared.
Thrown if parameter is immutable and therefore cannot be undeclared.
Thrown if parameter is modified while in a set callback.
Thrown if parameter is not declared, e.g. either set or get was called without first declaring.
Thrown when an uninitialized parameter is accessed.
ParameterUninitializedException(const std::string &name)
Construct an instance.
Thrown if a QoS compatibility check fails.
Created when the ret is RCL_RET_BAD_ALLOC.
Created when the return code does not match one of the other specialized exceptions.
Created when the ret is RCL_RET_INVALID_ARGUMENT.
Created when the ret is RCL_RET_INVALID_ROS_ARGS.
Thrown if user attempts to create an uninitialized statically typed parameter.
RCLCPP_PUBLIC UninitializedStaticallyTypedParameterException(const std::string &name)
Construct an instance.
Thrown when unparsed ROS specific arguments are found.
Thrown when an unknown type is passed.
Versions of rosidl_typesupport_cpp::get_message_type_support_handle that handle adapted types.
rmw_ret_t rcl_ret_t
The type that holds an rcl return code.