Skip to content

Commit

Permalink
fixed the double swallow of errors
Browse files Browse the repository at this point in the history
Signed-off-by: Berend Sliedrecht <[email protected]>
  • Loading branch information
berendsliedrecht committed Nov 18, 2023
1 parent b335f72 commit 32d0977
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/sdJwt/sdJwt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,15 +464,16 @@ export class SdJwt<
public assertNonSelectivelyDisclosableClaim(claimKey: string) {
try {
this.assertClaimInDisclosureFrame(claimKey)
throw new SdJwtError(
`Claim key '${claimKey}' was found in the disclosure frame. This claim is not allowed to be selectively disclosed`
)
} catch {}
} catch {
return
}
throw new SdJwtError(
`Claim key '${claimKey}' was found in the disclosure frame. This claim is not allowed to be selectively disclosed`
)
}

public assertNonSelectivelyDisclosableClaims() {
if (!this.disclosureFrame) return

;['_sd', '_sd_alg', '...'].forEach(
this.assertNonSelectivelyDisclosableClaim
)
Expand Down

0 comments on commit 32d0977

Please sign in to comment.