go
data_error
ai_generated
true
rpc error: code = InvalidArgument desc = invalid enum value: 99 for field status
ID: go/grpc-out-of-range-enum-value
80%Fix Rate
87%Confidence
0Evidence
2024-03-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 1.0 | active | — | — | — |
Root Cause
The client sends an integer that doesn't map to any defined enum value in the proto.
generic中文
客户端发送的整数未映射到 proto 中定义的任何枚举值。
Workarounds
-
95% success
if status < pb.Status_STATUS_UNKNOWN || status > pb.Status_STATUS_DONE { return error } -
80% success
// Use protoreflect to check if value is defined.
Dead Ends
Common approaches that don't work:
-
80% fail
Go will allow the conversion but protobuf deserialization will fail.
-
100% fail
The server will reject the message.