package grpcerrors

import "github.com/moby/buildkit/util/grpcerrors"

Index

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 any, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error

func ToGRPC

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

func UnaryClientInterceptor

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

func UnaryServerInterceptor

func UnaryServerInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp any, 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
}

Source Files

grpcerrors.go intercept.go

Version
v0.21.1 (latest)
Published
Apr 29, 2025
Platform
js/wasm
Imports
16 packages
Last checked
7 hours ago

Tools for package owners.