errx

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NotEmpty added in v0.0.12

func NotEmpty(err error, skips ...int) bool

func SetNotEmptyExit added in v0.0.12

func SetNotEmptyExit(t bool)

func SetTrack added in v0.0.12

func SetTrack(t bool)

Types

type Error

type Error struct {
	Status    int    `json:"status"`
	Error     string `json:"error"`
	Code      string `json:"code,omitempty"`
	Message   string `json:"message,omitempty"`
	Timestamp string `json:"ts"`
	TraceId   string `json:"tid"`
}

func BadRequest

func BadRequest(message string) *Error

func Conflict

func Conflict(message string) *Error

func Forbidden

func Forbidden(message string) *Error

func InternalError

func InternalError(message string) *Error

func New

func New(status int, message string) *Error

func NotAllowed

func NotAllowed(message string) *Error

func NotFound

func NotFound(message string) *Error

func OK

func OK(message string) *Error

func Unauthorized

func Unauthorized(message string) *Error

func (*Error) String

func (e *Error) String() string

func (*Error) WithCode

func (e *Error) WithCode(code string) *Error

func (*Error) WithContext

func (e *Error) WithContext(ctx context.Context) *Error

Jump to

Keyboard shortcuts

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