gRPC

gRPC 11 OUT_OF_RANGE vs 16 UNAUTHENTICATED

Both gRPC 11 (OUT_OF_RANGE) and 16 (UNAUTHENTICATED) belong to the gRPC Status Codes category. 11 indicates that the operation was attempted past the valid range. For example, seeking or reading past the end of a file. Meanwhile, 16 means that the request does not have valid authentication credentials for the operation.

Mô tả

The operation was attempted past the valid range. For example, seeking or reading past the end of a file.

Khi bạn thấy mã này

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.

Cách khắc phục

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.

Mô tả

The request does not have valid authentication credentials for the operation.

Khi bạn thấy mã này

No credentials were provided, or the provided token/certificate is expired or invalid. Different from PERMISSION_DENIED (code 7), which means authenticated but not authorized.

Cách khắc phục

Provide valid authentication credentials (e.g., refresh the OAuth token, regenerate the API key, or renew the client certificate).

Sự khác biệt chính

1.

gRPC 11: The operation was attempted past the valid range. For example, seeking or reading past the end of a file.

2.

gRPC 16: The request does not have valid authentication credentials for the operation.

3.

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.

4.

You encounter 16 when no credentials were provided, or the provided token/certificate is expired or invalid. Different from PERMISSION_DENIED (code 7), which means authenticated but not authorized.

Khi nào dùng cái nào

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. For 16 (UNAUTHENTICATED): Provide valid authentication credentials (e.g., refresh the OAuth token, regenerate the API key, or renew the client certificate).

Tìm hiểu thêm