diff --git a/pages/approve.tsx b/pages/approve.tsx
index 3a2c757..ed0afe6 100644
--- a/pages/approve.tsx
+++ b/pages/approve.tsx
@@ -95,6 +95,16 @@ function Approval({
.catch((error) => setErr(error));
}, [accessRequest, sessionFetch, getNameFromWebId]);
+ const checkErrorForNonExistingResource = (approveDenyError: any) => {
+ if (approveDenyError.response && approveDenyError.response.status === 404) {
+ return "Error: Granting access to a non-existing resource is not supported in Legacy pods.";
+ }
+ if ("message" in approveDenyError) {
+ return `${approveDenyError}`;
+ }
+ return `${approveDenyError.message}`;
+ };
+
useEffect(fetchAccessRequest, [fetchAccessRequest]);
return (
@@ -212,9 +222,8 @@ function Approval({
- {approveDenyError && "message" in approveDenyError
- ? `${approveDenyError}`
- : `${approveDenyError.message}`}
+ {approveDenyError &&
+ `${checkErrorForNonExistingResource(approveDenyError)}`}
{request && (