# rpc 错误：代码 = InvalidArgument 描述 = 字段 `status` 的枚举值无效：99

- **ID:** `go/grpc-invalid-argument-enum`
- **领域:** go
- **类别:** data_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

客户端为 protobuf 枚举字段发送了一个未在枚举中定义的整数值。这通常是因为客户端和服务器使用了不同版本的 .proto 定义。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.x | active | — | — |

## 解决方案

1. **** (90% 成功率)
   ```
   Run protoc with the updated status enum definition.
   ```
2. **** (80% 成功率)
   ```
   if status < 0 || status > 3 { return fmt.Errorf("invalid status") }
   ```

## 无效尝试

- **** — The value 99 is not a valid enum constant, so casting will not help. (80% 失败率)
- **** — Protobuf enums are strict by default; you would need to use a wrapper type. (70% 失败率)
