CW-1143-Fix-Ledger-wallets-getting-corruption-popups (#2447)

* fix: handle errors differently if it is a ledger wallet

* fix: improve ledger error code regex
This commit is contained in:
Konstantin Ullrich
2025-08-12 16:39:34 +03:00
committed by GitHub
parent 1a173e7e1e
commit af35c28152
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -74,7 +74,7 @@ class WalletLoadingService {
} catch (error, stack) {
await ExceptionHandler.resetLastPopupDate();
final isLedgerError = await ExceptionHandler.isLedgerError(error);
if (isLedgerError) rethrow;
if (isLedgerError || requireHardwareWalletConnection(type, name)) rethrow;
await ExceptionHandler.onError(FlutterErrorDetails(exception: error, stack: stack));
@@ -178,7 +178,7 @@ abstract class LedgerViewModelBase with Store {
return error;
}
var errorRegex = RegExp(r'0x\S*?(?= )').firstMatch(error.toString());
var errorRegex = RegExp(r'(?:0x\S*?|[0-9a-f]{4})(?= )').firstMatch(error.toString());
String errorCode = errorRegex?.group(0).toString().replaceAll("0x", "") ?? "";
if (errorCode.contains("6985")) {