HTTP 500 Internal Server Error vs gRPC 13 INTERNAL
HTTP 500 and gRPC INTERNAL are direct equivalents — both represent an unexpected server-side failure. They are catch-all error codes indicating a bug, a broken invariant, or an unhandled exception that the server could not classify into a more specific error.
Description
The server encountered an unexpected condition that prevented it from fulfilling the request. A generic catch-all for server-side errors.
Quand vous le voyez
When an unhandled exception occurs, a database connection fails, or server code has a bug.
Comment résoudre
Check server logs for the stack trace. Common causes: unhandled exceptions, database errors, misconfigurations.
Description
An internal error occurred. This means that some invariant expected by the underlying system has been broken.
Quand vous le voyez
A server-side bug, a corrupted internal state, or an unexpected failure in a dependency. This is the gRPC equivalent of HTTP 500.
Comment résoudre
Check the server error logs and traces for the root cause. This typically indicates a bug that needs to be fixed in the server code.
Différences clés
HTTP 500 is the most common server error on the web; gRPC INTERNAL is its direct counterpart in RPC systems.
Both are catch-all codes — use more specific codes when possible (502, 503 in HTTP; UNAVAILABLE, DATA_LOSS in gRPC).
HTTP 500 can include an error body (HTML error page, JSON error); gRPC INTERNAL uses a status message in trailers.
Both indicate a server-side bug that needs investigation — the client cannot fix the issue by changing the request.
gRPC INTERNAL should not be used for client errors; that distinction is clearer in gRPC than in HTTP.
Quand utiliser lequel
Return HTTP 500 for unhandled exceptions, assertion failures, or any server error that does not fit a more specific code. Return gRPC INTERNAL for the same scenarios in RPC services. In both cases, log the full error details server-side and return a generic message to the client to avoid leaking internals.