errors

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthErrors        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowErrors          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupErrors = fmt.Errorf("proto: unexpected end of group")
)

Functions

func Equal

func Equal(err1 error, err2 error) bool

Equal tries to compare errors

Types

type Child added in v0.6.1

type Child struct {
	Code   int32  `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Detail string `protobuf:"bytes,2,opt,name=detail,proto3" json:"detail,omitempty"`
}

func (*Child) Descriptor added in v0.6.1

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

func (*Child) GetCode added in v0.6.1

func (m *Child) GetCode() int32

func (*Child) GetDetail added in v0.6.1

func (m *Child) GetDetail() string

func (*Child) Marshal added in v0.6.1

func (m *Child) Marshal() (dAtA []byte, err error)

func (*Child) MarshalTo added in v0.6.1

func (m *Child) MarshalTo(dAtA []byte) (int, error)

func (*Child) MarshalToSizedBuffer added in v0.6.1

func (m *Child) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Child) ProtoMessage added in v0.6.1

func (*Child) ProtoMessage()

func (*Child) Reset added in v0.6.1

func (m *Child) Reset()

func (*Child) Size added in v0.6.1

func (m *Child) Size() (n int)

func (*Child) String added in v0.6.1

func (m *Child) String() string

func (*Child) Unmarshal added in v0.6.1

func (m *Child) Unmarshal(dAtA []byte) error

func (*Child) XXX_DiscardUnknown added in v0.6.1

func (m *Child) XXX_DiscardUnknown()

func (*Child) XXX_Marshal added in v0.6.1

func (m *Child) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Child) XXX_Merge added in v0.6.1

func (m *Child) XXX_Merge(src proto.Message)

func (*Child) XXX_Size added in v0.6.1

func (m *Child) XXX_Size() int

func (*Child) XXX_Unmarshal added in v0.6.1

func (m *Child) XXX_Unmarshal(b []byte) error

type Error

type Error struct {
	Id       string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Code     int32    `protobuf:"varint,2,opt,name=code,proto3" json:"code,omitempty"`
	Detail   string   `protobuf:"bytes,3,opt,name=detail,proto3" json:"detail,omitempty"`
	Status   string   `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"`
	Position string   `protobuf:"bytes,5,opt,name=position,proto3" json:"position,omitempty"`
	Child    *Child   `protobuf:"bytes,6,opt,name=child,proto3" json:"child,omitempty"`
	Stacks   []*Stack `protobuf:"bytes,7,rep,name=stacks,proto3" json:"stacks,omitempty"`
}

func BadGateway

func BadGateway(id, format string, a ...interface{}) *Error

BadGateway generates a 502 error

func BadRequest

func BadRequest(id, format string, a ...interface{}) *Error

BadRequest generates a 400 error.

func Conflict

func Conflict(id, format string, a ...interface{}) *Error

Conflict generates a 409 error.

func Forbidden

func Forbidden(id, format string, a ...interface{}) *Error

Forbidden generates a 403 error.

func FromErr

func FromErr(err error) *Error

FromErr try to convert go error go *Error

func GatewayTimeout

func GatewayTimeout(id, format string, a ...interface{}) *Error

GatewayTimeout generates a 504 error

func InternalServerError

func InternalServerError(id, format string, a ...interface{}) *Error

InternalServerError generates a 500 error.

func MethodNotAllowed

func MethodNotAllowed(id, format string, a ...interface{}) *Error

MethodNotAllowed generates a 405 error.

func New

func New(id, detail string, code int32) *Error

New generates a custom error.

func NotFound

func NotFound(id, format string, a ...interface{}) *Error

NotFound generates a 404 error.

func NotImplemented

func NotImplemented(id, format string, a ...interface{}) *Error

NotImplemented generates a 501 error

func Parse

func Parse(err string) *Error

Parse tries to parse a JSON string into an error. If that fails, it will set the given string as the error detail.

func ServiceUnavailable

func ServiceUnavailable(id, format string, a ...interface{}) *Error

ServiceUnavailable generates a 503 error

func Timeout

func Timeout(id, format string, a ...interface{}) *Error

Timeout generates a 408 error.

func Unauthorized

func Unauthorized(id, format string, a ...interface{}) *Error

Unauthorized generates a 401 error.

func (*Error) Descriptor

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

func (*Error) Error

func (e *Error) Error() string

func (*Error) GetChild added in v0.6.1

func (m *Error) GetChild() *Child

func (*Error) GetCode

func (m *Error) GetCode() int32

func (*Error) GetDetail

func (m *Error) GetDetail() string

func (*Error) GetId

func (m *Error) GetId() string

func (*Error) GetPosition

func (m *Error) GetPosition() string

func (*Error) GetStacks added in v0.6.0

func (m *Error) GetStacks() []*Stack

func (*Error) GetStatus

func (m *Error) GetStatus() string

func (*Error) Marshal

func (m *Error) Marshal() (dAtA []byte, err error)

func (*Error) MarshalTo

func (m *Error) MarshalTo(dAtA []byte) (int, error)

func (*Error) MarshalToSizedBuffer

func (m *Error) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) Reset

func (m *Error) Reset()

func (*Error) Size

func (m *Error) Size() (n int)

func (*Error) String

func (m *Error) String() string

func (*Error) Unmarshal

func (m *Error) Unmarshal(dAtA []byte) error

func (*Error) WithChild added in v0.6.1

func (e *Error) WithChild(code int32, format string, a ...interface{}) *Error

WithChild fills Error.Child

func (*Error) WithPos added in v0.6.1

func (e *Error) WithPos() *Error

WithPos fills Error.Position

func (*Error) WithStack added in v0.6.1

func (e *Error) WithStack(code int32, detail string, pos ...bool) *Error

WithStack push stack information to Error

func (*Error) XXX_DiscardUnknown

func (m *Error) XXX_DiscardUnknown()

func (*Error) XXX_Marshal

func (m *Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Error) XXX_Merge

func (m *Error) XXX_Merge(src proto.Message)

func (*Error) XXX_Size

func (m *Error) XXX_Size() int

func (*Error) XXX_Unmarshal

func (m *Error) XXX_Unmarshal(b []byte) error

type Stack added in v0.6.0

type Stack struct {
	Code     int32  `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Detail   string `protobuf:"bytes,2,opt,name=detail,proto3" json:"detail,omitempty"`
	Position string `protobuf:"bytes,3,opt,name=position,proto3" json:"position,omitempty"`
}

func (*Stack) Descriptor added in v0.6.0

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

func (*Stack) GetCode added in v0.6.0

func (m *Stack) GetCode() int32

func (*Stack) GetDetail added in v0.6.0

func (m *Stack) GetDetail() string

func (*Stack) GetPosition added in v0.6.0

func (m *Stack) GetPosition() string

func (*Stack) Marshal added in v0.6.0

func (m *Stack) Marshal() (dAtA []byte, err error)

func (*Stack) MarshalTo added in v0.6.0

func (m *Stack) MarshalTo(dAtA []byte) (int, error)

func (*Stack) MarshalToSizedBuffer added in v0.6.0

func (m *Stack) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Stack) ProtoMessage added in v0.6.0

func (*Stack) ProtoMessage()

func (*Stack) Reset added in v0.6.0

func (m *Stack) Reset()

func (*Stack) Size added in v0.6.0

func (m *Stack) Size() (n int)

func (*Stack) String added in v0.6.0

func (m *Stack) String() string

func (*Stack) Unmarshal added in v0.6.0

func (m *Stack) Unmarshal(dAtA []byte) error

func (*Stack) XXX_DiscardUnknown added in v0.6.0

func (m *Stack) XXX_DiscardUnknown()

func (*Stack) XXX_Marshal added in v0.6.0

func (m *Stack) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Stack) XXX_Merge added in v0.6.0

func (m *Stack) XXX_Merge(src proto.Message)

func (*Stack) XXX_Size added in v0.6.0

func (m *Stack) XXX_Size() int

func (*Stack) XXX_Unmarshal added in v0.6.0

func (m *Stack) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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