Repaso
Español
Backend & APIsCoreAPI-36

Your API returns 500 Internal Server Error. What does that usually indicate?

Options

  1. The user typed a wrong password when they tried to log in
  2. An unexpected error in the server code, like an unhandled exception (Correct option)
  3. The resource was not found at the URL that was requested
  4. 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.

Key terms

Practice this question in Repaso