Skip to content

Commit

Permalink
better error handler for credential offer issues
Browse files Browse the repository at this point in the history
  • Loading branch information
maycon-mello committed Jan 10, 2025
1 parent 6a8a7f2 commit fc61230
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/core/src/credentials/oidvc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ export async function acquireOpenIDCredentialFromURI({
holderKeyDocument,
});

if (!response) {
throw new Error('Unable to acquire credential. Please check your credential offer and try again.');
}

if (response.authorizationURL) {
const authorizationCode = await getAuthCode(response.authorizationURL);
response = await credentialServiceRPC.acquireOIDCredential({
Expand Down

0 comments on commit fc61230

Please sign in to comment.