errors

package
v0.0.0-...-349589a Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2019 License: MIT Imports: 6 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetServiceIdentifier

func SetServiceIdentifier(service Service)

Types

type Code

type Code struct {
	Service     Service
	ErrorType   Type
	ErrorNumber Number
}

func GenerateErrorCode

func GenerateErrorCode(errorType Type, errorNumber uint32) Code

func (*Code) FromProto

func (code *Code) FromProto(protoCode *proto.Error_Code)

func (*Code) String

func (code *Code) String() string

func (*Code) ToProto

func (code *Code) ToProto() *proto.Error_Code

func (*Code) UnmarshalText

func (code *Code) UnmarshalText(bytesArray []byte) error

type Error

type Error struct {
	Code    Code
	Message string
	Err     *Error
}

func FromMicroError

func FromMicroError(err *micro.Error) *Error

func FromNativeError

func FromNativeError(err error) *Error

func FromNetworkError

func FromNetworkError(err net.Error) *Error

func New

func New(code Code, message string, nativeError error) *Error

func ParseError

func ParseError(err error) *Error

func (*Error) Error

func (err *Error) Error() string

func (*Error) FromProto

func (err *Error) FromProto(protoError *proto.Error)

func (*Error) ParseError

func (err *Error) ParseError(nativeError error)

func (Error) ToError

func (err Error) ToError(nativeError error) *Error

func (Error) ToErrorWithArguments

func (err Error) ToErrorWithArguments(nativeError error, args ...interface{}) *Error

func (Error) ToProto

func (err Error) ToProto() *proto.Error

func (*Error) Unwrap

func (err *Error) Unwrap() *Error

type Number

type Number uint32

func (Number) String

func (number Number) String() string

type Service

type Service uint32

func (Service) String

func (service Service) String() string

type Type

type Type uint32
const (
	TypeUndefined Type = 0
	TypeService   Type = 1
	TypeNetwork   Type = 2
	TypeDateTime  Type = 3
	TypeMicro     Type = 4
	TypeLibrary   Type = 5
	TypeWrapper   Type = 6
)

func (*Type) FromProto

func (errorType *Type) FromProto(errorProto proto.Error_Code_Type)

func (Type) String

func (errorType Type) String() string

func (Type) ToProto

func (errorType Type) ToProto() proto.Error_Code_Type

Jump to

Keyboard shortcuts

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