errors

package
v1.1.13 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal(err1, err2 error) bool

func Is

func Is(err error, t Type) bool

Is reports whether err is an *Error of the given Type. If err is nil then Is returns false.

Types

type Error

type Error struct {
	Err  error
	Type Type
	// contains filtered or unexported fields
}

Error represents a error's specification.

func E

func E(args ...interface{}) *Error

E create a new error.

func T

func T(args ...interface{}) *Error

T create a new error with runtime stack trace.

func (*Error) Error

func (e *Error) Error() string

func (*Error) JSON

func (e *Error) JSON() interface{}

JSON creates a properly formatted JSON

func (*Error) MarshalJSON

func (e *Error) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface.

func (*Error) Meta

func (e *Error) Meta() string

func (*Error) SetMeta

func (e *Error) SetMeta(data Params) *Error

SetMeta sets the error's meta data.

func (*Error) String

func (e *Error) String() string

type Params

type Params map[string]interface{}

type Type

type Type uint16
const (
	TypeNone Type = iota
	TypePlatformUnmarshal
	TypePlatformNormalize
	TypePlatformUnknown
	TypePlatformRequest
	TypePlatformClient
	TypePlatformError
	TypePlatformApi
	TypeUnknown
)

func (Type) String

func (e Type) String() string

Jump to

Keyboard shortcuts

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