erikras / erikras/react-redux-universal-hot-example

Cannot catch error when LOGIN action fails in redux/modules/auth.js login function

Open
#643 2 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.