Skip to content

Commit e6a977e

Browse files
committed
chore: add coderabbit suggestion
1 parent 82f397e commit e6a977e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

sdk/src/gateway/client.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ export class GatewayApiClient {
592592
throw new Error('Invalid OP_RETURN hash');
593593
}
594594

595-
let psbtBase64: string;
595+
let psbtBase64: string = '';
596596
if (
597597
params.fromUserAddress &&
598598
typeof params.fromChain === 'string' &&
@@ -618,7 +618,13 @@ export class GatewayApiClient {
618618
};
619619
}
620620

621-
throw new Error('Failed to create bitcoin psbt. Please check `fromChain` and `fromUserAddress` parameters.');
621+
if (!psbtBase64) {
622+
throw new Error(
623+
'Failed to create bitcoin psbt. Please check `fromChain` and `fromUserAddress` parameters.'
624+
);
625+
}
626+
627+
throw new Error('Failed to create bitcoin psbt due to an unexpected error.');
622628
}
623629

624630
/**

0 commit comments

Comments
 (0)