Error Handling in Veramo Credential-w3c package.
See original GitHub issueIs your feature request related to a problem? Please describe. We are working heavily with the Veramo credential-w3c package and whenever we try to verify a presentation which is created with a broken credential for example with invalid issuance date or expiration date, we do not receive the error for why it failed and only receive a boolean stating false.
Describe the solution you’d like We would like to see the reason for why the verification failed as well. To find out what is broken in the credential or the verifiable presentation.
Additional context Code snippet where the error needs to be returned.
try {
const verification = await verifyPresentationJWT(jwt, resolver, {
challenge: args.challenge,
domain: args.domain,
audience,
})
return true
} catch (e: any) {
//TODO: return a more detailed reason for failure
return false
}
Issue Analytics
- State:
- Created a year ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Node Setup, Identifiers & Credentials - Veramo
This guide covers setting up an agent and creating identifiers in Node.
Read more >Verifiable Credentials Data Model v1.1 - W3C
Conforming processors MUST produce errors when non-conforming documents are consumed. This specification makes no normative statements with ...
Read more >Error handler package - Automation Anywhere Documentation
The Error handler package contains actions that enable you to easily handle exceptions a bot encounters and transfers control to the other ...
Read more >@veramo/credential-w3c [javascript]: Datasheet - Package Galaxy
npm package '@veramo/credential-w3c'. Popularity: Medium (more popular than 90% of all packages)
Read more >Exception handling in SSIS Package Dynamic Connection
How about setting --> Force execution Result property of the task to success.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You are right, a simple boolean result for legitimate failures is not enough. Likely a result object with some details is necessary.
There’s a target API we’re aiming for regarding verifications, so perhaps my answer makes more sense in context:
verify*()
methods should accept options for verificationverified
boolean property for the overall result and detail properties for all the policies.There are legitimate reasons to be able to override policies. For example, “was the credential valid at a particular timestamp?”, “does the credential verify against this older version of the DID document?”, “is the credential valid but revoked?”, “is the signature valid regardless of schema?”. Overrides should not necessarily be encouraged, but they should still be possible.
@mirceanis Love the approach of this.
It very much reflects what we already tried to deal with on an HTTP Layer. See “Request Parameters” here -> https://open-credentialing-initiative.github.io/api-specifications/latest/index.html#/VerifiablePresentation/postVerfiablePresentationGeneration
I think these Params we have in place there are pretty much what you imagine to be a ‘verification option’.
In case of failed business cases we return a structure like this:
I think this is pretty much 1:1 the same concept, just applied to another layer. From Client HTTP communication to Javascript/Typescript error handling and datastructures.
Really looking forward to the merge request @daniyal-khalil !