isolate a malformed card response to the card that caused it

This commit is contained in:
Craig Raw
2026-08-21 13:13:48 +02:00
parent 3e53f19353
commit 4989a881c1
2 changed files with 8 additions and 0 deletions
@@ -112,6 +112,11 @@ public class CardImportPane extends TitledDescriptionPane {
setError("Card Error", e.getMessage());
importButton.setDisable(false);
return;
} catch(Exception e) {
log.error("Error reading card", e);
setError("Card Error", e.getMessage() == null ? e.getClass().getSimpleName() : e.getMessage());
importButton.setDisable(false);
return;
}
CardImportService cardImportService = new CardImportService(importer, policyType, pin.get(), derivation, messageProperty);
@@ -98,6 +98,9 @@ public class Hwi {
//ignore
} catch(CardException e) {
log.info("Error reading card", e);
} catch(Exception e) {
//a card is free to return any bytes it likes, so a malformed response can surface as any runtime exception
log.error("Error reading card", e);
}
}