Merge pull request #327 from coralproject/error_translation_key

Error translation key
This commit is contained in:
David Erwin
2017-02-17 20:13:11 -05:00
committed by GitHub
5 changed files with 7 additions and 8 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ export const checkLogin = () => dispatch => {
})
.catch(error => {
console.error(error);
dispatch(checkLoginFailure(`${error.message}`));
dispatch(checkLoginFailure(`${error.translation_key}`));
});
};
+2 -2
View File
@@ -81,7 +81,7 @@ export const submitUser = () => (dispatch, getState) => {
})
.catch(error => {
console.error(error);
dispatch(installFailure(`${error.message}`));
dispatch(installFailure(`${error.translation_key}`));
});
});
};
@@ -104,6 +104,6 @@ export const checkInstall = next => dispatch => {
})
.catch(error => {
console.error(error);
dispatch(checkInstallFailure(`${error.message}`));
dispatch(checkInstallFailure(`${error.translation_key}`));
});
};
+2 -2
View File
@@ -123,7 +123,7 @@ export const fetchSignUp = (formData, redirectUri) => (dispatch) => {
dispatch(signUpSuccess(user));
})
.catch(error => {
dispatch(signUpFailure(lang.t(`error.${error.translation_key}`)));
dispatch(signUpFailure(lang.t(`error.${error.message}`)));
});
};
@@ -177,7 +177,7 @@ export const checkLogin = () => dispatch => {
})
.catch(error => {
console.error(error);
dispatch(checkLoginFailure(`${error.message}`));
dispatch(checkLoginFailure(`${error.translation_key}`));
});
};
@@ -26,7 +26,7 @@ class SuspendedAccount extends Component {
editName(username)
.then(() => location.reload())
.catch((error) => {
this.setState({alert: lang.t(`error.${error.message}`)});
this.setState({alert: lang.t(`error.${error.translation_key}`)});
});
} else {
this.setState({alert: lang.t('editName.error')});
+1 -2
View File
@@ -136,7 +136,7 @@ router.post('/', (req, res, next) => {
res.status(201).json(user);
});
})
.catch(err => {
.catch((err) => {
next(err);
});
});
@@ -163,7 +163,6 @@ router.post('/:user_id/actions', authorization.needed(), (req, res, next) => {
res.status(201).json(action);
})
.catch((err) => {
console.log('Error', err);
next(err);
});
});