# rpc error: code = OutOfRange desc = index out of range: 10 (max 5)

- **ID:** `go/grpc-out-of-range-invalid-argument`
- **Domain:** go
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The client provided a parameter that is outside the valid range, such as an index or a value exceeding limits.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.x | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   if index >= len(slice) {
    return fmt.Errorf("index %d out of range", index)
}
// Proceed with RPC
   ```
2. **** (90% success)
   ```
   resp, err := client.Method(ctx, req)
if status.Code(err) == codes.OutOfRange {
    // Log and return user-friendly error
    return fmt.Errorf("invalid parameter: %v", err)
}
   ```

## Dead Ends

- **** — This may not be semantically correct and could hide client-side bugs. (70% fail)
- **** — The operation will likely fail or produce incorrect results. (90% fail)
