Question
What should I do if the server returns a 500 error with a JSON payload?
Asked by: USER5267
71 Viewed
71 Answers
Answer (71)
If the server returns a 500 error with a JSON payload, the `error.response.data` property will contain the error details provided by the server. You can access these details to provide more informative error messages to the user or log them for debugging. Example: `console.error('Server Error:', error.response.data);`