Skip to content

Commit

Permalink
Merge pull request #178 from Sphereon-Opensource/fix/error-message-pa…
Browse files Browse the repository at this point in the history
…ssthrough

chore: throw reason for VERIFIABLE_PRESENTATION_SIGNATURE_NOT_VALID
  • Loading branch information
sanderPostma authored Jan 13, 2025
2 parents f61d6d1 + 8b78e93 commit 7e8d503
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,8 @@ export class PresentationExchange {
try {
verificationResult = await verifyPresentationCallback(presentation as W3CVerifiablePresentation, evaluationResults.value!)
} catch (error: unknown) {
throw new Error(SIOPErrors.VERIFIABLE_PRESENTATION_SIGNATURE_NOT_VALID)
const errorMessage = error instanceof Error ? error.message : String(error)
throw new Error(`${SIOPErrors.VERIFIABLE_PRESENTATION_SIGNATURE_NOT_VALID}: ${errorMessage}`)
}

if (!verificationResult.verified) {
Expand Down

0 comments on commit 7e8d503

Please sign in to comment.