How to Map Errors Across Protocols
Different protocols use different error codes for the same logical conditions. This decision tree helps you find the equivalent error code when integrating HTTP APIs with gRPC backends, WebSocket connections, DNS lookups, or SMTP delivery — keeping your error semantics consistent across layers.
Decision Steps
Are you starting from an HTTP error and need to find the equivalent in another protocol?
Is the HTTP error a 401 or 403 (authentication/authorization)?
Is it a 401 (no credentials / invalid credentials)?
Is the HTTP error a 404 (not found)?
Is the HTTP error a 5xx (server error: 500, 503, 504)?
Is it a 503 or 504 (service unavailable or timeout)?
Are you starting from a gRPC error and need the HTTP equivalent?
Is the gRPC error UNAUTHENTICATED (16) or PERMISSION_DENIED (7)?