mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2025-01-05 09:27:22 +03:00
don't swallow context disposed exceptions
This commit is contained in:
parent
769aeda6d3
commit
a79e2dace8
@ -24,17 +24,11 @@ extension Decoder on PlatformException {
|
|||||||
|
|
||||||
bool _isApduException() => code == 'ApduException';
|
bool _isApduException() => code == 'ApduException';
|
||||||
|
|
||||||
bool _isContextDisposed() => code == 'ContextDisposedException';
|
|
||||||
|
|
||||||
Exception decode() {
|
Exception decode() {
|
||||||
if (_isCancellation()) {
|
if (_isCancellation()) {
|
||||||
return CancellationException();
|
return CancellationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_isContextDisposed()) {
|
|
||||||
return CancellationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (message != null && _isApduException()) {
|
if (message != null && _isApduException()) {
|
||||||
final regExp = RegExp(
|
final regExp = RegExp(
|
||||||
r'^com.yubico.yubikit.core.smartcard.ApduException: APDU error: 0x(.*)$');
|
r'^com.yubico.yubikit.core.smartcard.ApduException: APDU error: 0x(.*)$');
|
||||||
|
Loading…
Reference in New Issue
Block a user