Documentation ¶
Index ¶
- func FromError(err error) error
- func StreamClientInterceptor(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, ...) (grpc.ClientStream, error)
- func StreamServerInterceptor(srv any, ss grpc.ServerStream, _ *grpc.StreamServerInfo, ...) error
- func UnaryClientInterceptor(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, ...) error
- func UnaryServerInterceptor(ctx context.Context, req any, _ *grpc.UnaryServerInfo, ...) (any, error)
- type Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StreamClientInterceptor ¶
func StreamClientInterceptor(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption, ) (grpc.ClientStream, error)
StreamClientInterceptor intercepts errors, de-serialising any WrappedErrors we find and unpacking any context jettison key-values.
func StreamServerInterceptor ¶
func StreamServerInterceptor( srv any, ss grpc.ServerStream, _ *grpc.StreamServerInfo, handler grpc.StreamHandler, ) error
StreamServerInterceptor intercepts errors, de-serialising any WrappedErrors we find and unpacking any context jettison key-values.
func UnaryClientInterceptor ¶
func UnaryClientInterceptor(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption, ) error
UnaryClientInterceptor intercepts errors, de-serialising any // WrappedErrors we find and unpacking any context jettison key-values.
func UnaryServerInterceptor ¶
func UnaryServerInterceptor(ctx context.Context, req any, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler, ) (any, error)
UnaryServerInterceptor intercepts errors, de-serialising any WrappedErrors we find and unpacking any context jettison key-values.
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error wraps an error and a status. For outgoing errors, it allows us to create the grpc status and store it until needed. For incoming errors, we can store the original status from grpc, so we can check it later for certain codes this allows us to communicate context errors across grpc.
func Wrap ¶
Wrap will construct an Error that will serialise err when needed by gRPC by exposing the GRPCStatus method