From 290c4decdbd3662065644d5a940c0a85bd3f06d3 Mon Sep 17 00:00:00 2001 From: Jakub Delicat Date: Tue, 5 Nov 2024 09:19:24 +0000 Subject: [PATCH] Added logger when no can device Signed-off-by: Jakub Delicat --- wibotic_connector_can/src/wibotic_can_driver_node.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wibotic_connector_can/src/wibotic_can_driver_node.cpp b/wibotic_connector_can/src/wibotic_can_driver_node.cpp index 67236e1..cefb2f8 100644 --- a/wibotic_connector_can/src/wibotic_can_driver_node.cpp +++ b/wibotic_connector_can/src/wibotic_can_driver_node.cpp @@ -30,7 +30,13 @@ WiboticCanDriverNode::WiboticCanDriverNode( DeclareParameters(); GetParameters(); - CreateWiboticCanDriver(); + try { + CreateWiboticCanDriver(); + } catch (const uavcan_linux::Exception & e) { + RCLCPP_FATAL_STREAM( + this->get_logger(), "An occurred error during creating WiboticCanDriver: " << e.what()); + throw; + } wibotic_info_pub_ = this->create_publisher("wibotic_info", 10);