Skip to content

Commit

Permalink
improve samourai backup import error message
Browse files Browse the repository at this point in the history
  • Loading branch information
craigraw committed Apr 25, 2024
1 parent d625bab commit 599880e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/com/sparrowwallet/sparrow/io/Samourai.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.google.common.io.CharStreams;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
import com.google.gson.reflect.TypeToken;
import com.sparrowwallet.drongo.Utils;
import com.sparrowwallet.drongo.crypto.SamouraiUtil;
Expand Down Expand Up @@ -57,6 +58,8 @@ public Keystore getKeystore(ScriptType scriptType, InputStream inputStream, Stri
Keystore keystore = Keystore.fromSeed(seed, scriptType.getDefaultDerivation());
keystore.setLabel(getWalletModel().toDisplayString());
return keystore;
} catch(JsonParseException e) {
throw new ImportException("Failed to decrypt the wallet backup file, check if the password is correct.");
} catch(ImportException e) {
throw e;
} catch(Exception e) {
Expand Down

0 comments on commit 599880e

Please sign in to comment.