mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-02 12:14:09 +01:00
handle more ledger cases [skip ci]
This commit is contained in:
@@ -173,7 +173,14 @@ abstract class LedgerViewModelBase with Store {
|
||||
}
|
||||
}
|
||||
|
||||
String? interpretErrorCode(String errorCode) {
|
||||
String? interpretErrorCode(String error) {
|
||||
if (error.contains("Make sure no other program is communicating with the Ledger")) {
|
||||
return error;
|
||||
}
|
||||
|
||||
var errorRegex = RegExp(r'0x\S*?(?= )').firstMatch(error.toString());
|
||||
|
||||
String errorCode = errorRegex?.group(0).toString().replaceAll("0x", "") ?? "";
|
||||
if (errorCode.contains("6985")) {
|
||||
return S.current.ledger_error_tx_rejected_by_user;
|
||||
} else if (errorCode.contains("5515")) {
|
||||
|
||||
Reference in New Issue
Block a user