Your API returns 500 Internal Server Error. What does that usually indicate?
Options
- The user typed a wrong password when they tried to log in
- An unexpected error in the server code, like an unhandled exception (Correct option)
- The resource was not found at the URL that was requested
- The request succeeded and the server returned the data
Answer
An unexpected error in the server code, e.g. an unhandled exception
Why
500 means the server failed in a way it did not expect: often an exception nobody caught (a bug), or a crashed dependency.
The client cannot fix it by changing the request. Check the server logs and the stack trace.
Good APIs catch known problems and return a specific 4xx code instead.
Remember
500 = bug or crash on the server. Check the logs.