Handling errors
Learn how to implement error handling.
We'll cover the following...
Our current example ignores error handling. To solve this problem, we need to extend our middleware to catch server errors and dispatch events when they happen:
axios.get(url)
.then(({ data }) => dispatch(onSuccess(data)))
.catch(error =>
...