Skip to content

Commit 597e548

Browse files
committed
fix(sdk-api): improve decryptAsync error message for wrong password
WCN-30 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> TICKET: WCN-30
1 parent 7cbd571 commit 597e548

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

modules/sdk-api/src/bitgoAPI.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,8 +747,11 @@ export class BitGoAPI implements BitGoBase {
747747
try {
748748
return await decryptAsync(params.password, params.input);
749749
} catch (error) {
750-
if (error.message.includes("ccm: tag doesn't match")) {
751-
error.message = 'password error - ' + error.message;
750+
if (
751+
error.message.includes("ccm: tag doesn't match") ||
752+
error.message.includes('The operation failed for an operation-specific reason')
753+
) {
754+
throw new Error('incorrect password');
752755
}
753756
throw error;
754757
}

0 commit comments

Comments
 (0)