perror

package
v0.1.140 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrTypeWarn   = "warn"
	ErrTypeError  = "err"
	ErrTypeIgnore = "ignore"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	// contains filtered or unexported fields
}

Exception panic as exception

func New

func New(status int, msg ...interface{}) *Error

NewPError create new error with status and message errType=warn

func NewIgnore added in v0.1.119

func NewIgnore(status int, msg ...interface{}) *Error

NewIgnore create new error with status and message errType=ignore

func NewWarn added in v0.1.119

func NewWarn(status int, msg ...interface{}) *Error

NewWarn create new error with status and message errType=warn

func (*Error) ErrType added in v0.1.119

func (p *Error) ErrType() string

ErrType return errType

func (*Error) Error

func (p *Error) Error() string

Error implement error interface

func (*Error) IsErrTypeErr added in v0.1.119

func (p *Error) IsErrTypeErr() bool

IsErrTypeErr return is err

func (*Error) IsErrTypeIgnore added in v0.1.119

func (p *Error) IsErrTypeIgnore() bool

IsErrTypeIgnore return is ignore

func (*Error) IsErrTypeWarn added in v0.1.119

func (p *Error) IsErrTypeWarn() bool

IsErrTypeWarn return is warn

func (*Error) Message

func (p *Error) Message() string

GetMessage get exception message string

func (*Error) Status

func (p *Error) Status() int

GetStatus get exception status code

Jump to

Keyboard shortcuts

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