Documentation ¶
Overview ¶
Package errgrpc provides utility functions for translating errors to and from a gRPC context.
The functions ToGRPC and ToNative can be used to map server-side and client-side errors to the correct types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToGRPC ¶
ToGRPC will attempt to map the error into a grpc error, from the error types defined in the the errdefs package and attempign to preserve the original description. Any type which does not resolve to a defined error type will be assigned the unknown error code.
Further information may be extracted from certain errors depending on their type. The grpc error details will be used to attempt to preserve as much of the error structures and types as possible.
Errors which can be marshaled using protobuf or typeurl will be considered for including as GRPC error details. Additionally, use the following interfaces in errors to preserve custom types:
WrapError(error) error - Used to wrap the previous error JoinErrors(...error) error - Used to join all previous errors CollapseError() - Used for errors which carry information but should not have their error message shown.
Types ¶
This section is empty.