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
|
||||
// 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.");
|
||||
|
|
Loading…
Reference in a new issue