diff --git a/src/gConsent/manage/revokeAccessGrant.ts b/src/gConsent/manage/revokeAccessGrant.ts index 81d33bde..adf36c1a 100644 --- a/src/gConsent/manage/revokeAccessGrant.ts +++ b/src/gConsent/manage/revokeAccessGrant.ts @@ -71,7 +71,7 @@ async function revokeAccessCredential( !credential.has(quad(namedNode(getId(credential)), TYPE, vcType)), ) ) { - throw new Error( + throw new AccessGrantError( `An error occurred when type checking the VC: Not of type [${types.map((type) => type.value).join("] or [")}]`, ); } diff --git a/src/gConsent/request/issueAccessRequest.ts b/src/gConsent/request/issueAccessRequest.ts index 354ce611..9be6ca2f 100644 --- a/src/gConsent/request/issueAccessRequest.ts +++ b/src/gConsent/request/issueAccessRequest.ts @@ -165,7 +165,7 @@ async function issueAccessRequest( normalize: normalizeAccessRequest, }); if (!isAccessRequest(accessRequest)) { - throw new Error( + throw new AccessGrantError( `${JSON.stringify(accessRequest)} is not an Access Request`, ); }