javascript - 422 Not returning send message(Node.js/Redux) -


i having issue node.js server returning 422 browser message browser seeing 422 , nothing it.

//node.js  if (existinguser) {  return res.status(422).send({ error: 'email in use' }); } 

i can confirm hitting there , returning @ point

//redux method export function signupuser({ email, password }) {  return function(dispatch) {   return axios.post(`${root_url}/signup`, { email, password })    .then(response => {     dispatch(emailwassent(response.data.return_msg));    })    .catch(response => {     dispatch(autherror(response.data.error));});   } } 

it hit catch response contains 422

//console.log of response error: request failed status code 422 

after looking around day found out axios issue. changed catch case. should be

error.response.data.error 

Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -