errors

package
v0.0.0-...-e55081e Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UnknownCode is unknown code for error info.
	UnknownCode = nethttp.StatusInternalServerError
	// UnknownReason is unknown reason for error info.
	UnknownReason = "UNKNOWN"

	// SupportPackageIsVersion1 this constant should not be referenced by any other code.
	SupportPackageIsVersion1 = true
)

Variables

View Source
var (
	Code      = errors.Code
	Reason    = errors.Reason
	FromError = errors.FromError
	Clone     = errors.Clone
	New       = errors.New
	Newf      = errors.Newf
	Errorf    = errors.Errorf
)
View Source
var (
	BadRequest = errors.BadRequest
	NotFound   = errors.NotFound
)
View Source
var (
	// optional int32 code = 2109;
	E_Code = &file_errors_status_proto_extTypes[1]
)

Extension fields to descriptorpb.EnumValueOptions.

View Source
var (
	// optional int32 default_code = 2108;
	E_DefaultCode = &file_errors_status_proto_extTypes[0]
)

Extension fields to descriptorpb.EnumOptions.

View Source
var File_errors_status_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Error

type Error = errors.Error

func MethodNotAllowed

func MethodNotAllowed(reason, message string) *Error

MethodNotAllowed new MethodNotAllowed error that is mapped to a 405 response.

func NotAcceptable

func NotAcceptable(reason, message string) *Error

NotAcceptable new NotAcceptable error that is mapped to a 406

type Status

type Status struct {
	Code     int32             `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Reason   string            `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"`
	Message  string            `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	Metadata map[string]string `` /* 157-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Status) Descriptor deprecated

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

Deprecated: Use Status.ProtoReflect.Descriptor instead.

func (*Status) GetCode

func (x *Status) GetCode() int32

func (*Status) GetMessage

func (x *Status) GetMessage() string

func (*Status) GetMetadata

func (x *Status) GetMetadata() map[string]string

func (*Status) GetReason

func (x *Status) GetReason() string

func (*Status) ProtoMessage

func (*Status) ProtoMessage()

func (*Status) ProtoReflect

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

func (*Status) Reset

func (x *Status) Reset()

func (*Status) String

func (x *Status) String() string

Jump to

Keyboard shortcuts

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