gRPC 2 UNKNOWN vs 11 OUT_OF_RANGE
Both gRPC 2 (UNKNOWN) and 11 (OUT_OF_RANGE) belong to the gRPC Status Codes category. 2 indicates that an unknown error occurred. This may be returned when a server raises an exception that doesn't map to any known gRPC status code. Meanwhile, 11 means that the operation was attempted past the valid range. For example, seeking or reading past the end of a file.
Deskripsi
An unknown error occurred. This may be returned when a server raises an exception that doesn't map to any known gRPC status code.
Ketika Anda Melihatnya
The server threw an unhandled exception or returned an error that gRPC couldn't classify into a more specific status code.
Cara Memperbaiki
Check the server logs for the underlying exception. Wrap server-side errors with explicit gRPC status codes instead of letting them bubble up as UNKNOWN.
Deskripsi
The operation was attempted past the valid range. For example, seeking or reading past the end of a file.
Ketika Anda Melihatnya
A pagination offset exceeded the available data, or an iterator moved past the end of a collection. Unlike INVALID_ARGUMENT, this depends on the current state of the data.
Cara Memperbaiki
Check the valid range before making the request. For pagination, use the total count or next-page token to avoid requesting beyond the last page.
Perbedaan Utama
gRPC 2: An unknown error occurred. This may be returned when a server raises an exception that doesn't map to any known gRPC status code.
gRPC 11: The operation was attempted past the valid range. For example, seeking or reading past the end of a file.
You encounter 2 when the server threw an unhandled exception or returned an error that gRPC couldn't classify into a more specific status code.
You encounter 11 when a pagination offset exceeded the available data, or an iterator moved past the end of a collection. Unlike INVALID_ARGUMENT, this depends on the current state of the data.
Kapan Menggunakan Yang Mana
For 2 (UNKNOWN): Check the server logs for the underlying exception. Wrap server-side errors with explicit gRPC status codes instead of letting them bubble up as UNKNOWN. For 11 (OUT_OF_RANGE): Check the valid range before making the request. For pagination, use the total count or next-page token to avoid requesting beyond the last page.