I'm using React-native version 0.62.2, Axios version ^0.19.2 express version ^4.17.1
In express im using
if (!user) {
return res.status(404).send({email:'email not exist'})
}
But the thing is on front end (react-native) side using axios,i'm getting following in catch: [Error: Request failed with status code 404] and not the err.response
code on react-native side using axios
export const onLogin = userData => {
return dispatch => {
dispatch(onFetching());
Axios.post(`${Routes.login}`, userData)
.then(res => {
console.log(res)
})
.catch(err => {
console.log(err)
});
};
};
so am i doing anything wrong here?
Can you update your post with a minimal working example demonstrating your problem
import axios from 'axios'
const instance = axios.create({
timeout: 1000,
validateStatus: function validateStatus(status) {
let default = status >= 200 && status < 300
let extra = status == 404
return default || extra
}
});
export default instance;
so whats exactyly happening hear his
