mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-24 06:48:38 +02:00
feat: better backup errors (#2290)
Instead of creating error reports show the error to user use BackupVersion.unknown
This commit is contained in:
@@ -45,12 +45,11 @@ abstract class RestoreFromBackupViewModelBase with Store {
|
||||
|
||||
try {
|
||||
await backupService.importBackupFile(file, password);
|
||||
} catch (e, s) {
|
||||
} catch (e) {
|
||||
if (e.toString().contains("unknown_backup_version")) {
|
||||
state = FailureState('This is not a valid backup file, please make sure you selected the correct backup file');
|
||||
state = FailureState('This is not a valid backup file, please make sure you have selected the correct one');
|
||||
} else {
|
||||
state = FailureState('Failed to restore backup, please try again');
|
||||
ExceptionHandler.onError(FlutterErrorDetails(exception: e, stack: s));
|
||||
state = FailureState(e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user