mirror of
https://github.com/trussed-dev/usbd-ccid.git
synced 2026-06-20 04:16:20 -07:00
Log errors
This commit is contained in:
+7
-3
@@ -137,15 +137,19 @@ where
|
||||
packet.resize_default(packet.capacity()).unwrap();
|
||||
let result = self.read.read(&mut packet);
|
||||
result.map(|count| {
|
||||
packet.resize_default(count).unwrap();
|
||||
assert!(count <= packet.len());
|
||||
packet.truncate(count);
|
||||
packet
|
||||
})
|
||||
};
|
||||
|
||||
// should we return an error message
|
||||
// if the raw packet is invalid?
|
||||
if let Ok(packet) = maybe_packet {
|
||||
self.pipe.handle_packet(packet);
|
||||
match maybe_packet {
|
||||
Ok(packet) => self.pipe.handle_packet(packet),
|
||||
Err(_err) => {
|
||||
error!("Failed to read packet: {:?}", _err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user