Search⌘ K
AI Features

Handling errors

Understand how to extend Redux middleware to catch server errors, dispatch error actions, and implement custom failure handlers for API requests. This lesson helps you manage error scenarios effectively in your Redux applications.

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 =>
...