500 Internal Server Error
The HTTP status meaning something went wrong inside the server while handling the request.
In more detail
The body should be a safe problem document with no stack trace or database details; the full exception belongs in protected logs. It is the generic 5xx answer for an unexpected failure, and a later retry may succeed.
Example
In the APIs course: The course fault called the leaky five hundred puts the exception into the body, and the contract suite catches it.Related terms
- leaky error — An error response that reveals private details such as a stack trace, a database query, a secret or internal names.
- Problem Details — A standard JSON shape for HTTP error responses, defined in RFC 9457, with members such as type, title, status, detail and instance.
- stack trace — The list of function calls that were running when an error happened, printed to help a developer find where it came from; Python calls it a traceback.
- HTTP status code — The three-digit number at the start of a response, such as 200 or 404, that says how the server handled the request.
- exception handler middleware — ASP.NET Core middleware, added with app.UseExceptionHandler(), that catches unhandled exceptions from later components and returns a safe error response.
- correlation ID — A unique value attached to one request and passed along everywhere it goes, so its logs and traces can be found together.
Taught in
- Error Handling And Safe Retries — Modern API Architecture: REST, GraphQL & gRPC
- Problem Details: RFC 9457 — Modern API Architecture: REST, GraphQL & gRPC
- Contract Testing — Modern API Architecture: REST, GraphQL & gRPC
- Global Exception Handling and Problem Details — Modern .NET Core, C# & Enterprise Microservices
- Exception Handling To Problem Details — Modern Java: Virtual Threads & High-Throughput Services