From a7fb5b2b2c7fe864f5dd9e791bbcd924b3fa6cb9 Mon Sep 17 00:00:00 2001 From: Heiko Schaefer Date: Mon, 29 Nov 2021 21:26:16 +0100 Subject: [PATCH] Don't fail while enumerating readers, when a reader returns an error (just log). This is useful with hubs that can power down individual ports: when a port is powered down, the reader is still visible to pcsc, but connecting to it returns an error. --- pcsc/src/lib.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pcsc/src/lib.rs b/pcsc/src/lib.rs index c70092d..4993ff7 100644 --- a/pcsc/src/lib.rs +++ b/pcsc/src/lib.rs @@ -100,9 +100,12 @@ impl PcscClient { continue; // try next reader } Err(err) => { - return Err(SmartcardError::SmartCardConnectionError( - err.to_string(), - )); + log::warn!( + "Error connecting to card in reader: {:x?}", + err + ); + + continue; } };