Break from macro
This commit is contained in:
parent
87788e8912
commit
50d8b89fd2
1 changed files with 16 additions and 9 deletions
|
@ -54,7 +54,10 @@ macro_rules! transaction {
|
||||||
// the caller always expects a card that has not
|
// the caller always expects a card that has not
|
||||||
// been "select"ed yet.
|
// been "select"ed yet.
|
||||||
if $reselect {
|
if $reselect {
|
||||||
TxClient::select(&mut txc)?;
|
match TxClient::select(&mut txc) {
|
||||||
|
Ok(_) => {}
|
||||||
|
Err(err) => break Err(err),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tx = txc.tx();
|
tx = txc.tx();
|
||||||
|
@ -73,17 +76,21 @@ macro_rules! transaction {
|
||||||
log::debug!("start_tx: do reconnect");
|
log::debug!("start_tx: do reconnect");
|
||||||
|
|
||||||
{
|
{
|
||||||
c.reconnect(
|
match c.reconnect(
|
||||||
mode,
|
mode,
|
||||||
Protocols::ANY,
|
Protocols::ANY,
|
||||||
Disposition::ResetCard,
|
Disposition::ResetCard,
|
||||||
)
|
) {
|
||||||
.map_err(|e| {
|
Ok(_) => {}
|
||||||
Error::Smartcard(SmartcardError::Error(format!(
|
Err(err) => {
|
||||||
|
break Err(Error::Smartcard(
|
||||||
|
SmartcardError::Error(format!(
|
||||||
"Reconnect failed: {:?}",
|
"Reconnect failed: {:?}",
|
||||||
e
|
err
|
||||||
)))
|
)),
|
||||||
})?;
|
))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log::debug!("start_tx: reconnected.");
|
log::debug!("start_tx: reconnected.");
|
||||||
|
|
Loading…
Reference in a new issue