Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"lint:js": "./node_modules/.bin/eslint --ext .js,.jsx .",
"test": "npm run lint && npm run jest"
},
"version": "1.2.5",
"version": "1.2.6",
"dependencies": {
"auth0-js": "^6.8.4",
"config": "^3.2.0",
Expand Down
16 changes: 12 additions & 4 deletions src/reducers/challenge.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,18 @@ function onGetDetailsInit(state, action) {
function onGetDetailsDone(state, action) {
if (action.error) {
logger.error('Failed to get challenge details!', action.payload);
fireErrorMessage(
'ERROR: Failed to load the challenge',
'Please, try again a bit later',
);
if (action.payload.message === 'Forbidden') {
fireErrorMessage(
'ERROR: Private challenge',
'This challenge is only available to those in a private group.'
+ ' It looks like you do not have access to this challenge.',
);
} else {
fireErrorMessage(
'ERROR: Failed to load the challenge',
'Please, try again a bit later',
);
}
return {
...state,
fetchChallengeFailure: action.error,
Expand Down
2 changes: 1 addition & 1 deletion src/services/challenges.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ async function checkErrorV5(res) {
if (res.status >= 500) {
setErrorIcon(ERROR_ICON_TYPES.API, '/challenges', res.statusText);
}
throw new Error(res.statusText);
throw new Error((!res.statusText && res.status === 403) ? 'Forbidden' : res.statusText);
}
const jsonRes = (await res.json());
if (jsonRes.message) {
Expand Down