Skip to content

Commit 599880e

Browse files
committed
improve samourai backup import error message
1 parent d625bab commit 599880e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/com/sparrowwallet/sparrow/io/Samourai.java

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.google.common.io.CharStreams;
44
import com.google.gson.Gson;
55
import com.google.gson.JsonElement;
6+
import com.google.gson.JsonParseException;
67
import com.google.gson.reflect.TypeToken;
78
import com.sparrowwallet.drongo.Utils;
89
import com.sparrowwallet.drongo.crypto.SamouraiUtil;
@@ -57,6 +58,8 @@ public Keystore getKeystore(ScriptType scriptType, InputStream inputStream, Stri
5758
Keystore keystore = Keystore.fromSeed(seed, scriptType.getDefaultDerivation());
5859
keystore.setLabel(getWalletModel().toDisplayString());
5960
return keystore;
61+
} catch(JsonParseException e) {
62+
throw new ImportException("Failed to decrypt the wallet backup file, check if the password is correct.");
6063
} catch(ImportException e) {
6164
throw e;
6265
} catch(Exception e) {

0 commit comments

Comments
 (0)