File tree 1 file changed +14
-6
lines changed
modules/sdk-core/src/bitgo/wallet
1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -2192,12 +2192,20 @@ export class Wallet implements IWallet {
2192
2192
} else {
2193
2193
txPrebuildQuery = params . prebuildTx ? Promise . resolve ( params . prebuildTx ) : this . prebuildTransaction ( params ) ;
2194
2194
}
2195
-
2196
- const [ keychains , txPrebuild ] = ( await Promise . all ( [ keychainPromise , txPrebuildQuery ] ) ) as [
2197
- Keychain [ ] ,
2198
- PrebuildTransactionResult
2199
- ] ;
2200
-
2195
+ let keychains : Keychain [ ] ;
2196
+ let txPrebuild : PrebuildTransactionResult ;
2197
+ try {
2198
+ [ keychains , txPrebuild ] = ( await Promise . all ( [ keychainPromise , txPrebuildQuery ] ) ) as [
2199
+ Keychain [ ] ,
2200
+ PrebuildTransactionResult
2201
+ ] ;
2202
+ } catch ( err ) {
2203
+ if ( err || ( err instanceof Error && err . message . includes ( 'unable to decrypt keychain' ) ) ) {
2204
+ throw new Error ( 'unable to decrypt keychain with the given wallet passphrase' ) ;
2205
+ } else {
2206
+ throw new Error ( `Failed to process transaction: ${ err . message } ` ) ;
2207
+ }
2208
+ }
2201
2209
try {
2202
2210
await this . baseCoin . verifyTransaction ( {
2203
2211
txParams : { ...txPrebuild . buildParams , ...params } ,
You can’t perform that action at this time.
0 commit comments