rclcpp
master
C++ ROS Client Library API
|
Go to the documentation of this file.
15 #ifndef RCLCPP__EXCEPTIONS__EXCEPTIONS_HPP_
16 #define RCLCPP__EXCEPTIONS__EXCEPTIONS_HPP_
22 #include "rcl/error_handling.h"
26 #include "rcpputils/join.hpp"
46 const char * name_type_,
48 const char * error_msg_,
49 size_t invalid_index_)
131 const rcl_error_state_t * error_state =
nullptr,
132 void (* reset_error)() = rcl_reset_error);
176 const rcl_error_state_t * error_state,
199 "found unknown ROS arguments: '" + rcpputils::join(unknown_ros_args_in,
"', '") +
"'"),
253 :
std::
runtime_error(
"parameter '" + name +
"' has invalid type: " + message)
295 :
std::
runtime_error(
"parameter '" + name +
"' requires an user provided parameter override")
316 #endif // RCLCPP__EXCEPTIONS__EXCEPTIONS_HPP_
size_t line
Definition: exceptions.hpp:145
RCLErrorBase(rcl_ret_t ret, const rcl_error_state_t *error_state)
Thrown when a any kind of name (node, namespace, topic, etc.) is invalid.
Definition: exceptions.hpp:42
EventNotRegisteredError()
Definition: exceptions.hpp:219
Thrown if passed parameters are inconsistent or invalid.
Definition: exceptions.hpp:224
Thrown when a node namespace is invalid.
Definition: exceptions.hpp:77
RCLInvalidROSArgsError(rcl_ret_t ret, const rcl_error_state_t *error_state, const std::string &prefix)
Created when the return code does not match one of the other specialized exceptions.
Definition: exceptions.hpp:150
Thrown if a QoS compatibility check fails.
Definition: exceptions.hpp:307
Thrown when a node name is invalid.
Definition: exceptions.hpp:68
Thrown when an unregistered rclcpp::Event is encountered where a registered one was expected.
Definition: exceptions.hpp:216
Definition: exceptions.hpp:103
NoParameterOverrideProvided(const std::string &name)
Construct an instance.
Definition: exceptions.hpp:294
InvalidServiceNameError(const char *namespace_, const char *error_msg, size_t invalid_index)
Definition: exceptions.hpp:98
InvalidTopicNameError(const char *namespace_, const char *error_msg, size_t invalid_index)
Definition: exceptions.hpp:89
const std::vector< std::string > unknown_ros_args
Definition: exceptions.hpp:204
Thrown when a topic name is invalid.
Definition: exceptions.hpp:86
Definition: exceptions.hpp:135
This header provides the get_node_base_interface() template function.
Definition: allocator_common.hpp:24
#define RCLCPP_PUBLIC
Definition: visibility_control.hpp:50
virtual ~RCLErrorBase()
Definition: exceptions.hpp:140
InvalidNamespaceError(const char *namespace_, const char *error_msg, size_t invalid_index)
Definition: exceptions.hpp:80
UnknownROSArgsError(std::vector< std::string > &&unknown_ros_args_in)
Definition: exceptions.hpp:197
Thrown when a service name is invalid.
Definition: exceptions.hpp:95
RCLBadAlloc(rcl_ret_t ret, const rcl_error_state_t *error_state)
Thrown when an invalid rclcpp::Event object or SharedPtr is encountered.
Definition: exceptions.hpp:208
Thrown if parameter is immutable and therefore cannot be undeclared.
Definition: exceptions.hpp:272
Thrown if passed parameter value is invalid.
Definition: exceptions.hpp:232
Thrown if parameter is already declared.
Definition: exceptions.hpp:258
RCLInvalidArgument(rcl_ret_t ret, const rcl_error_state_t *error_state, const std::string &prefix)
std::string formatted_message
Definition: exceptions.hpp:146
const std::string error_msg
Definition: exceptions.hpp:63
Thrown if parameter is modified while in a set callback.
Definition: exceptions.hpp:279
InvalidNodeNameError(const char *node_name, const char *error_msg, size_t invalid_index)
Definition: exceptions.hpp:71
std::string message
Definition: exceptions.hpp:143
UnimplementedError()
Definition: exceptions.hpp:106
const std::string name
Definition: exceptions.hpp:62
const std::string name_type
Definition: exceptions.hpp:61
RCLError(rcl_ret_t ret, const rcl_error_state_t *error_state, const std::string &prefix)
Thrown when a parameter override wasn't provided and one was required.
Definition: exceptions.hpp:286
rcl_ret_t ret
Definition: exceptions.hpp:142
std::string file
Definition: exceptions.hpp:144
InvalidEventError()
Definition: exceptions.hpp:211
Created when the ret is RCL_RET_INVALID_ROS_ARGS.
Definition: exceptions.hpp:183
Thrown when unparsed ROS specific arguments are found.
Definition: exceptions.hpp:194
UnimplementedError(const std::string &msg)
Definition: exceptions.hpp:108
void throw_from_rcl_error(rcl_ret_t ret, const std::string &prefix="", const rcl_error_state_t *error_state=nullptr, void(*reset_error)()=rcl_reset_error)
Throw a C++ std::exception which was created based on an rcl error.
Thrown if the QoS overrides provided aren't valid.
Definition: exceptions.hpp:300
Thrown if requested parameter type is invalid.
Definition: exceptions.hpp:243
const size_t invalid_index
Definition: exceptions.hpp:64
Thrown if parameter is not declared, e.g. either set or get was called without first declaring.
Definition: exceptions.hpp:265
InvalidNodeError()
Definition: exceptions.hpp:37
static std::string format_error(const char *name_type, const char *name, const char *error_msg, size_t invalid_index)
Created when the ret is RCL_RET_INVALID_ARGUMENT.
Definition: exceptions.hpp:170
NameValidationError(const char *name_type_, const char *name_, const char *error_msg_, size_t invalid_index_)
Definition: exceptions.hpp:45
InvalidParameterTypeException(const std::string &name, const std::string message)
Construct an instance.
Definition: exceptions.hpp:252
Thrown when a method is trying to use a node, but it is invalid.
Definition: exceptions.hpp:34
Created when the ret is RCL_RET_BAD_ALLOC.
Definition: exceptions.hpp:160