Comprehensive error handling specification
interface ErrorResponse { status: number; // HTTP status code message: string; // Human-readable description error_code: string; // Machine-parseable identifier }
{ "status": 500, "message": "Database operation failed: write concern error", "error_code": "DATABASE_ERROR" }
{ "status": 404, "message": "Resource not found in collection", "error_code": "NOT_FOUND" }
{ "status": 400, "message": "Invalid input: constraint violation", "error_code": "INVALID_INPUT" }
{ "status": 500, "message": "Internal error: system constraint violation", "error_code": "INTERNAL_ERROR" }
{ "status": 429, "message": "Rate limit exceeded: throughput constraint violation", "error_code": "RATE_LIMIT_EXCEEDED" }