Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(storagenode): add gRPC error codes to the log server
This patch adds gRPC error codes to the RPCs of the log server in the storage node. Previously the storage node had no use of gRPC error codes. Instead, it used the `verrors` package that serializes and deserializes the error messages into and from strings. ``` +-------------+ +-------------------------+ | | | Client | | | | Library +------------+ | +------------+ | | | | | | | | | User | sentinel | | | encode error | | | Application |<----error------+ RPC Client |<+--message into -| RPC Server | | | | | | | Details | | | | | | | | | | | | | +------------+ | +------------+ | | | | +-------------+ +-------------------------+ ``` However, comparing strings to identify errors is an anti-pattern in Go. Moreover, the `verrors` package has not been maintained for a long time and has no straightforward interface. So, we are trying to adopt gRPC error codes. ``` +-------------+ +-------------------------+ | | | Client | | | | Library +------------+ | +------------+ | | | | | | | | | User | sentinel | | | gRPC status | | | Application |<----error------+ RPC Client |<+-----code-------| RPC Server | | | | | | | | | | | | | | | | | | | | +------------+ | +------------+ | | | | +-------------+ +-------------------------+ ``` For further information, I add some links for the Detail fields of gRPC. - https://pkg.go.dev/google.golang.org/genproto/googleapis/rpc/status#Status - https://cloud.google.com/apis/design/errors#error_details Updates #312
- Loading branch information