diff --git a/src/gConsent/discover/getAccessApiEndpoint.ts b/src/gConsent/discover/getAccessApiEndpoint.ts index 4dad5760..116bca1c 100644 --- a/src/gConsent/discover/getAccessApiEndpoint.ts +++ b/src/gConsent/discover/getAccessApiEndpoint.ts @@ -23,7 +23,6 @@ import type { UrlString } from "@inrupt/solid-client"; import { parse } from "auth-header"; import type { AccessBaseOptions } from "../type/AccessBaseOptions"; import { AccessGrantError } from "../../common/errors/AccessGrantError"; -import { UmaError } from "../../common/errors/UmaError"; async function getAccessEndpointForResource( resource: UrlString, diff --git a/src/gConsent/discover/getAccessManagementUi.ts b/src/gConsent/discover/getAccessManagementUi.ts index 22166151..3f02ec9d 100644 --- a/src/gConsent/discover/getAccessManagementUi.ts +++ b/src/gConsent/discover/getAccessManagementUi.ts @@ -30,6 +30,7 @@ import { import { getSessionFetch } from "../../common/util/getSessionFetch"; import type { AccessBaseOptions } from "../type/AccessBaseOptions"; import { PIM_STORAGE, PREFERRED_CONSENT_MANAGEMENT_UI } from "../constants"; +import { AccessGrantError } from "../../common/errors/AccessGrantError"; interface AccessManagementUiFromProfile { accessEndpoint?: UrlString; @@ -48,12 +49,14 @@ async function getAccessManagementUiFromProfile( fetch: options.fetch, }); } catch (e) { - throw new Error(`Cannot get the Access Management UI for ${webId}: ${e}.`); + throw new AccessGrantError( + `Cannot get the Access Management UI for ${webId}: ${e}.`, + ); } const profile = getThing(webIdDocument, webId); if (profile === null) { - throw new Error( + throw new AccessGrantError( `Cannot get the Access Management UI for ${webId}: the WebID cannot be dereferenced.`, ); }