mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-04 21:36:45 +00:00
improve samourai backup import error message
This commit is contained in:
parent
d625bab02e
commit
599880ea5c
1 changed files with 3 additions and 0 deletions
|
@ -3,6 +3,7 @@ package com.sparrowwallet.sparrow.io;
|
||||||
import com.google.common.io.CharStreams;
|
import com.google.common.io.CharStreams;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.JsonElement;
|
import com.google.gson.JsonElement;
|
||||||
|
import com.google.gson.JsonParseException;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
import com.sparrowwallet.drongo.Utils;
|
import com.sparrowwallet.drongo.Utils;
|
||||||
import com.sparrowwallet.drongo.crypto.SamouraiUtil;
|
import com.sparrowwallet.drongo.crypto.SamouraiUtil;
|
||||||
|
@ -57,6 +58,8 @@ public class Samourai implements KeystoreFileImport {
|
||||||
Keystore keystore = Keystore.fromSeed(seed, scriptType.getDefaultDerivation());
|
Keystore keystore = Keystore.fromSeed(seed, scriptType.getDefaultDerivation());
|
||||||
keystore.setLabel(getWalletModel().toDisplayString());
|
keystore.setLabel(getWalletModel().toDisplayString());
|
||||||
return keystore;
|
return keystore;
|
||||||
|
} catch(JsonParseException e) {
|
||||||
|
throw new ImportException("Failed to decrypt the wallet backup file, check if the password is correct.");
|
||||||
} catch(ImportException e) {
|
} catch(ImportException e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
|
|
Loading…
Reference in a new issue