Skip to content

Commit

Permalink
403-specific error message (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulineribeyre authored May 12, 2022
1 parent b480d60 commit d64df06
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const _showUserMessage = (queryParamApplied, message, dialog = {}) => {
return;
}

const { show: showUserMessage = () => {} } = dialog;
const { show: showUserMessage = () => { } } = dialog;
showUserMessage({
message,
});
Expand Down Expand Up @@ -416,10 +416,14 @@ function ViewerRetrieveStudyData({

if (error) {
const content = JSON.stringify(error);
if (content.includes('404') || content.includes('NOT_FOUND')) {
if (error.status == 404 || content.includes('404') || content.includes('NOT_FOUND')) {
return <NotFound />;
}

if (error.status == 403) {
return <NotFound message="You do not have access to this data" />;
}

return <NotFound message="Failed to retrieve study data" />;
}

Expand Down

0 comments on commit d64df06

Please sign in to comment.