errorx

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnaryServerInterceptor

func UnaryServerInterceptor() grpc.UnaryServerInterceptor

UnaryServerInterceptor intercepts a GRPC server response and wrap the error proto

Types

type GrpcError

type GrpcError struct {
	Code            codes.Code
	UnderlyingError *errorx.Error
}

GrpcError defines GRPC error wrapper for gogox error

func New added in v0.2.2

func New(code codes.Code, underlyingErr *errorx.Error) *GrpcError

func (*GrpcError) Error

func (e *GrpcError) Error() string

Error implements error interface

func (*GrpcError) GRPCStatus

func (e *GrpcError) GRPCStatus() *status.Status

GRPCStatus implements GRPCStatus interface that is required by grpc server handler

func (*GrpcError) GRPCStatusWithDetails

func (e *GrpcError) GRPCStatusWithDetails() (*status.Status, error)

GRPCStatusWithDetails return status with details containing the gogox error instance

Jump to

Keyboard shortcuts

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