Break from macro

This commit is contained in:
Heiko Schaefer 2022-02-14 15:41:36 +01:00
parent 87788e8912
commit 50d8b89fd2
No known key found for this signature in database
GPG key ID: 4A849A1904CCBD7D

View file

@ -54,7 +54,10 @@ macro_rules! transaction {
// the caller always expects a card that has not
// been "select"ed yet.
if $reselect {
TxClient::select(&mut txc)?;
match TxClient::select(&mut txc) {
Ok(_) => {}
Err(err) => break Err(err),
}
}
tx = txc.tx();
@ -73,17 +76,21 @@ macro_rules! transaction {
log::debug!("start_tx: do reconnect");
{
c.reconnect(
match c.reconnect(
mode,
Protocols::ANY,
Disposition::ResetCard,
)
.map_err(|e| {
Error::Smartcard(SmartcardError::Error(format!(
) {
Ok(_) => {}
Err(err) => {
break Err(Error::Smartcard(
SmartcardError::Error(format!(
"Reconnect failed: {:?}",
e
)))
})?;
err
)),
))
}
}
}
log::debug!("start_tx: reconnected.");