Skip to content

Commit cd6d3e3

Browse files
committed
chore: revert changes in prev commit
Ticket: CAAS-7
1 parent 3c2e848 commit cd6d3e3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

modules/sdk-core/src/bitgo/wallet/wallet.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2200,7 +2200,15 @@ export class Wallet implements IWallet {
22002200
PrebuildTransactionResult
22012201
];
22022202
} catch (err) {
2203-
throw new Error(`Failed to process transaction: ${err.message}`);
2203+
if (err !== null || (err instanceof Error && err.message.includes('unable to decrypt keychain'))) {
2204+
const error: Error & { code?: string } = new Error(
2205+
`unable to decrypt keychain with the given wallet passphrase`
2206+
);
2207+
error.code = 'wallet_passphrase_incorrect';
2208+
throw error;
2209+
} else {
2210+
throw new Error(`Failed to process transaction: ${err.message}`);
2211+
}
22042212
}
22052213
try {
22062214
await this.baseCoin.verifyTransaction({

0 commit comments

Comments
 (0)