Skip to content

Commit de4cd83

Browse files
committed
chore: Improve error log output when device/serial port creation files
1 parent eb9ca0a commit de4cd83

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

crates/buttplug_server/src/device/server_device.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,16 +161,19 @@ impl ServerDevice {
161161
let mut protocol_identifier = None;
162162
let mut hardware_out = None;
163163
for protocol_specializer in protocol_specializers {
164-
if let Ok(specialized_hardware) = hardware_specializer
165-
.specialize(protocol_specializer.specifiers())
166-
.await
167-
{
168-
protocol_identifier = Some(protocol_specializer.identify());
169-
hardware_out = Some(specialized_hardware);
170-
break;
164+
match hardware_specializer.specialize(protocol_specializer.specifiers()).await {
165+
Ok(specialized_hardware) => {
166+
protocol_identifier = Some(protocol_specializer.identify());
167+
hardware_out = Some(specialized_hardware);
168+
break;
169+
}
170+
Err(e) => {
171+
error!("{:?}", e.to_string());
172+
}
171173
}
172174
}
173175

176+
174177
if protocol_identifier.is_none() {
175178
return Err(ButtplugDeviceError::DeviceConfigurationError(
176179
"No protocols with viable communication matches for hardware.".to_owned(),

crates/buttplug_server_hwmgr_serial/src/serialport_hardware.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ impl SerialPortHardware {
226226
.await
227227
.expect("This will always be a Some value, we're just blocking for bringup")
228228
.map_err(|e| {
229+
error!("Serial port recv creation error: {:?}", e);
229230
ButtplugDeviceError::DeviceSpecificError(
230231
HardwareSpecificError::HardwareSpecificError("Serial".to_owned(), e.to_string())
231232
.to_string(),

0 commit comments

Comments
 (0)