grpcerrors

package
v0.0.0-...-2745715 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsGRPCStatus

func AsGRPCStatus(err error) (*status.Status, bool)

func Code

func Code(err error) codes.Code

func FromGRPC

func FromGRPC(err error) error

func StreamClientInterceptor

func StreamClientInterceptor(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error)

func StreamServerInterceptor

func StreamServerInterceptor(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error

func ToGRPC

func ToGRPC(ctx context.Context, err error) error

func ToRPCStatus

func ToRPCStatus(st *spb.Status) *rpc.Status

func UnaryClientInterceptor

func UnaryClientInterceptor(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error

func UnaryServerInterceptor

func UnaryServerInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)

func WrapCode

func WrapCode(err error, code codes.Code) error

Types

type TypedError

type TypedError interface {
	ToProto() TypedErrorProto
}

type TypedErrorProto

type TypedErrorProto interface {
	proto.Message
	WrapError(error) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL