rclcpp  beta1
C++ ROS Client Library API
Classes | Functions
rclcpp::exceptions Namespace Reference

Classes

class  EventNotRegisteredError
 Thrown when an unregistered rclcpp::Event is encountered where a registered one was expected. More...
 
class  InvalidEventError
 Thrown when an invalid rclcpp::Event object or SharedPtr is encountered. More...
 
class  InvalidNodeError
 Thrown when a method is trying to use a node, but it is invalid. More...
 
class  RCLBadAlloc
 Created when the ret is RCL_RET_BAD_ALLOC. More...
 
class  RCLError
 Created when the return code does not match one of the other specialized exceptions. More...
 
class  RCLErrorBase
 
class  RCLInvalidArgument
 Created when the ret is RCL_RET_INVALID_ARGUMENT. More...
 

Functions

void throw_from_rcl_error (rcl_ret_t ret, const std::string &prefix="", bool reset_error=true)
 Throw a C++ std::exception which was created based on an rcl error. More...
 

Function Documentation

§ throw_from_rcl_error()

void rclcpp::exceptions::throw_from_rcl_error ( rcl_ret_t  ret,
const std::string prefix = "",
bool  reset_error = true 
)

Throw a C++ std::exception which was created based on an rcl error.

Parameters
retthe return code for the current error state
prefixstring to prefix to the error if applicable (not all errors have custom messages)
reset_errorif true rcl_reset_error() is called before returning
Exceptions
std::invalid_argumentif ret is RCL_RET_OK
std::runtime_errorif the rcl_get_error_state returns 0
RCLErrorBasesome child class exception based on ret