diff --git a/.circleci/config.yml b/.circleci/config.yml index 0e161844..e8eac28e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,7 +28,7 @@ jobs: - attach_workspace: at: . - run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - - run: npm publish + - run: npm publish --tag test-release # dont change anything workflows: version: 2 diff --git a/package.json b/package.json index 30e2676e..4a2bd0d9 100644 --- a/package.json +++ b/package.json @@ -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": "v1000.29.0", "dependencies": { "auth0-js": "^6.8.4", "config": "^3.2.0", diff --git a/src/reducers/challenge.js b/src/reducers/challenge.js index db116631..b73a6c97 100644 --- a/src/reducers/challenge.js +++ b/src/reducers/challenge.js @@ -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, diff --git a/src/services/challenges.js b/src/services/challenges.js index 38ae8c5e..b08b0750 100644 --- a/src/services/challenges.js +++ b/src/services/challenges.js @@ -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) {