diff --git a/frontend/src/network/tests/server-handlers.js b/frontend/src/network/tests/server-handlers.js index c565d4cfb7..fdad0844f1 100644 --- a/frontend/src/network/tests/server-handlers.js +++ b/frontend/src/network/tests/server-handlers.js @@ -372,7 +372,7 @@ const faultyHandlers = [ return res.once( ctx.status(403), ctx.json({ - SubCode: `PrivateProject`, + error:{sub_code: `PRIVATE_PROJECT_NOT_ALLOWED`} }), ); }), diff --git a/frontend/src/utils/promise.js b/frontend/src/utils/promise.js index a9af63507a..2ee009b416 100644 --- a/frontend/src/utils/promise.js +++ b/frontend/src/utils/promise.js @@ -24,7 +24,7 @@ export async function handleErrors(response) { .clone() .json() .then((res) => { - text = res.SubCode || response.statusText; + text = res.error?.sub_code || res.SubCode || response.statusText; }); throw Error(text); } diff --git a/frontend/src/views/project.js b/frontend/src/views/project.js index 321bbd8826..ac80dd3fb8 100644 --- a/frontend/src/views/project.js +++ b/frontend/src/views/project.js @@ -198,7 +198,7 @@ export const ProjectDetailPage = () => { )} {error && ( <> - {error.message === 'PrivateProject' ? ( + {error.message === 'PRIVATE_PROJECT_NOT_ALLOWED' ? ( ) : (