Question · JavaScript and React course · Module 11: Data Fetching and APIs

Error Handling in Axios

Which property of the Axios error object contains the server response data (e.g., status 404)?

Answer options

  • error.response - contains the status, data, and headers of the server response
  • error.message - contains the full server response
  • error.data - contains the parsed JSON response
  • error.status - contains only the HTTP code

You can check the correct answer by solving this task in the CodeWorlds game.