diff --git a/rclcpp/include/rclcpp/node_impl.hpp b/rclcpp/include/rclcpp/node_impl.hpp index 8d126b8..3b5a75c 100644 --- a/rclcpp/include/rclcpp/node_impl.hpp +++ b/rclcpp/include/rclcpp/node_impl.hpp @@ -53,11 +53,9 @@ Node::Node(const std::string & node_name, context::Context::SharedPtr context) if (ros_domain_id) { unsigned long number = strtoul(ros_domain_id, NULL, 0); if (number == (std::numeric_limits::max)()) { - fprintf(stderr, - "Failed to interpret ROS_DOMAIN_ID '%s' as integral number\n", ros_domain_id); - } else { - domain_id = static_cast(number); + throw std::runtime_error("failed to interpret ROS_DOMAIN_ID as integral number"); } + domain_id = static_cast(number); } auto node = rmw_create_node(name_.c_str(), domain_id);