Skip to content

Commit ae8c514

Browse files
committed
Fix polymorphic exception captures
1 parent dc25c23 commit ae8c514

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

vesc_driver/src/vesc_device_uuid_lookup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ VescDeviceLookup::VescDeviceLookup(std::string name)
4040
try {
4141
vesc_.connect(device_);
4242
vesc_.requestFWVersion();
43-
} catch (SerialException e) {
43+
} catch (SerialException &e) {
4444
std::cerr << "VESC error on port " << device_ << std::endl << e.what() << std::endl;
4545
return;
4646
}

vesc_driver/src/vesc_driver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ VescDriver::VescDriver(const rclcpp::NodeOptions & options)
7171
// attempt to connect to the serial port
7272
try {
7373
vesc_.connect(port);
74-
} catch (SerialException e) {
74+
} catch (SerialException &e) {
7575
RCLCPP_FATAL(get_logger(), "Failed to connect to the VESC, %s.", e.what());
7676
rclcpp::shutdown();
7777
return;

0 commit comments

Comments
 (0)