erikras / erikras/react-redux-universal-hot-example
Cannot catch error when LOGIN action fails in redux/modules/auth.js login function
Open
- Dominant language
- JavaScript
- Stars
- 12.1k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
I've taken this example project to be the base for client side code and implemented my own API.
When calling login mehtod from `redux/modules/auth.js` and server responds with any HTTP error code (e.g. 401/422/500), then the promise returned is always resolved, never reaches the `catch` method. Although, `ApiClient` expectedly rejects the promise, when the API responds with an error.
```
this.props.login(email, password).then(() => {
console.log('success');
}).catch(() => {
console.log('fail');
});
```
Contributor guide
Assessment
This issue has not been assessed yet.