error

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Aborted            = WithCode(codes.Aborted)
	AlreadyExists      = WithCode(codes.AlreadyExists)
	Canceled           = WithCode(codes.Canceled)
	DataLoss           = WithCode(codes.DataLoss)
	DeadlineExceeded   = WithCode(codes.DeadlineExceeded)
	FailedPrecondition = WithCode(codes.FailedPrecondition)
	Internal           = WithCode(codes.Internal)
	InvalidArgument    = WithCode(codes.InvalidArgument)
	NotFound           = WithCode(codes.NotFound)
	OutOfRange         = WithCode(codes.OutOfRange)
	PermissionDenied   = WithCode(codes.PermissionDenied)
	ResourceExhausted  = WithCode(codes.ResourceExhausted)
	Unavailable        = WithCode(codes.Unavailable)
	Unauthenticated    = WithCode(codes.Unauthenticated)
	Unimplemented      = WithCode(codes.Unimplemented)
	Unknown            = WithCode(codes.Unknown)
)
View Source
var File_error_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type ErrorDetail

type ErrorDetail struct {

	// code is the unique error instance identifier.
	Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	// status
	Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	// message describes the specific error occurrence.
	Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	// public indicates the error can be displayed publically
	Public bool `protobuf:"varint,4,opt,name=public,proto3" json:"public,omitempty"`
	// stack entries
	StackEntries []string `protobuf:"bytes,5,rep,name=stack_entries,json=stackEntries,proto3" json:"stack_entries,omitempty"`
	// contains filtered or unexported fields
}

func Convert

func Convert(err error) *ErrorDetail

Convert error to ErrorDetail

func (*ErrorDetail) Descriptor deprecated

func (*ErrorDetail) Descriptor() ([]byte, []int)

Deprecated: Use ErrorDetail.ProtoReflect.Descriptor instead.

func (*ErrorDetail) GetCode

func (x *ErrorDetail) GetCode() int32

func (*ErrorDetail) GetMessage

func (x *ErrorDetail) GetMessage() string

func (*ErrorDetail) GetPublic

func (x *ErrorDetail) GetPublic() bool

func (*ErrorDetail) GetStackEntries

func (x *ErrorDetail) GetStackEntries() []string

func (*ErrorDetail) GetStatus

func (x *ErrorDetail) GetStatus() string

func (*ErrorDetail) ProtoMessage

func (*ErrorDetail) ProtoMessage()

func (*ErrorDetail) ProtoReflect

func (x *ErrorDetail) ProtoReflect() protoreflect.Message

func (*ErrorDetail) Reset

func (x *ErrorDetail) Reset()

func (*ErrorDetail) String

func (x *ErrorDetail) String() string

type GrpcError

type GrpcError func(msg string, errors ...error) error

GrpcError returns a status error from the given message and list of errors

func WithCode

func WithCode(code codes.Code) GrpcError

WithCode returns a prepared function with the respective code

Jump to

Keyboard shortcuts

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