don't swallow context disposed exceptions

This commit is contained in:
Adam Velebil 2024-09-11 07:25:11 +02:00
parent 769aeda6d3
commit a79e2dace8
No known key found for this signature in database
GPG Key ID: C9B1E4A3CBBD2E10

View File

@ -24,17 +24,11 @@ extension Decoder on PlatformException {
bool _isApduException() => code == 'ApduException';
bool _isContextDisposed() => code == 'ContextDisposedException';
Exception decode() {
if (_isCancellation()) {
return CancellationException();
}
if (_isContextDisposed()) {
return CancellationException();
}
if (message != null && _isApduException()) {
final regExp = RegExp(
r'^com.yubico.yubikit.core.smartcard.ApduException: APDU error: 0x(.*)$');