Documentation ¶
Index ¶
- Variables
- func CheckErrorByCode(err error, code int32) bool
- func HTTPError(ctx context.Context, mux *runtime.ServeMux, marshaler runtime.Marshaler, ...)
- func New(httpStatus int32, grpcStatus codes.Code, code int32, message string, ...) error
- func NewGeneralError400(errorMessage string) error
- func NewGeneralError500(errorMessage string) error
- type Error
- func (*Error) Descriptor() ([]byte, []int)deprecated
- func (x *Error) GetCode() int32
- func (x *Error) GetGRPCStatus() int32
- func (x *Error) GetHTTPStatus() int32
- func (x *Error) GetMessage() string
- func (x *Error) GetOtherErrors() []*ErrorDetail
- func (*Error) ProtoMessage()
- func (x *Error) ProtoReflect() protoreflect.Message
- func (x *Error) Reset()
- func (x *Error) String() string
- type ErrorDetail
- func (*ErrorDetail) Descriptor() ([]byte, []int)deprecated
- func (x *ErrorDetail) GetCode() int32
- func (x *ErrorDetail) GetField() string
- func (x *ErrorDetail) GetMessage() string
- func (*ErrorDetail) ProtoMessage()
- func (x *ErrorDetail) ProtoReflect() protoreflect.Message
- func (x *ErrorDetail) Reset()
- func (x *ErrorDetail) String() string
Constants ¶
This section is empty.
Variables ¶
View Source
var File_errors_proto protoreflect.FileDescriptor
Functions ¶
func CheckErrorByCode ¶
func NewGeneralError400 ¶
func NewGeneralError500 ¶
Types ¶
type Error ¶
type Error struct { HTTPStatus int32 `protobuf:"varint,1,opt,name=HTTPStatus,json=http_status,proto3" json:"HTTPStatus,omitempty"` GRPCStatus int32 `protobuf:"varint,2,opt,name=GRPCStatus,json=grpc_status,proto3" json:"GRPCStatus,omitempty"` Code int32 `protobuf:"varint,3,opt,name=Code,json=code,proto3" json:"Code,omitempty"` Message string `protobuf:"bytes,4,opt,name=Message,json=message,proto3" json:"Message,omitempty"` OtherErrors []*ErrorDetail `protobuf:"bytes,5,rep,name=OtherErrors,json=other_errors,proto3" json:"OtherErrors,omitempty"` // contains filtered or unexported fields }
func NewFromError ¶
func (*Error) Descriptor
deprecated
func (*Error) GetGRPCStatus ¶
func (*Error) GetHTTPStatus ¶
func (*Error) GetMessage ¶
func (*Error) GetOtherErrors ¶
func (x *Error) GetOtherErrors() []*ErrorDetail
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
func (*Error) ProtoReflect ¶
func (x *Error) ProtoReflect() protoreflect.Message
type ErrorDetail ¶
type ErrorDetail struct { Code int32 `protobuf:"varint,1,opt,name=Code,json=code,proto3" json:"Code,omitempty"` Field string `protobuf:"bytes,2,opt,name=Field,json=field,proto3" json:"Field,omitempty"` Message string `protobuf:"bytes,3,opt,name=Message,json=message,proto3" json:"Message,omitempty"` // contains filtered or unexported fields }
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) GetField ¶
func (x *ErrorDetail) GetField() string
func (*ErrorDetail) GetMessage ¶
func (x *ErrorDetail) GetMessage() 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
Click to show internal directories.
Click to hide internal directories.