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(
"Service type is invalid.") {}
109 : std::runtime_error(msg) {}
116 : std::runtime_error(
"This code is unimplemented.") {}
118 : std::runtime_error(msg) {}
121 typedef void (* reset_error_function_t)();
139 throw_from_rcl_error [[noreturn]] (
141 const std::string & prefix =
"",
142 const rcl_error_state_t * error_state =
nullptr,
143 reset_error_function_t reset_error = rcl_reset_error);
157 std::string formatted_message;
165 RCLError(
rcl_ret_t ret,
const rcl_error_state_t * error_state,
const std::string & prefix);
187 const rcl_error_state_t * error_state,
188 const std::string & prefix);
199 rcl_ret_t ret,
const rcl_error_state_t * error_state,
const std::string & prefix);
209 : std::runtime_error(
210 "found unknown ROS arguments: '" + rcpputils::join(unknown_ros_args_in,
"', '") +
"'"),
211 unknown_ros_args(unknown_ros_args_in)
215 const std::vector<std::string> unknown_ros_args;
223 : std::runtime_error(
"Unknown type: " + type) {}
231 : std::runtime_error(
"event is invalid") {}
239 : std::runtime_error(
"event already registered") {}
247 : std::runtime_error(
"cannot create: " + obj_type +
" , callback group not in node") {}
255 using std::runtime_error::runtime_error;
262 using std::runtime_error::runtime_error;
280 : std::runtime_error(
"parameter '" + name +
"' has invalid type: " + message)
297 : std::runtime_error(
"Statically typed parameter '" + name +
"' must be initialized.")
305 using std::runtime_error::runtime_error;
312 using std::runtime_error::runtime_error;
319 using std::runtime_error::runtime_error;
326 using std::runtime_error::runtime_error;
338 : std::runtime_error(
"parameter '" + name +
"' is not initialized")
346 using std::runtime_error::runtime_error;
353 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.