fail

package
v0.0.0-...-244d273 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFail

func NewFail(code int, message string) error

func NewFailByError

func NewFailByError(code int, err error, message string) error

Types

type Fail

type Fail struct {
	Message string `json:"message"` // Human readable message for clients
	Code    int    `json:"-"`       // HTTP Status code. We use `-` to skip json marshaling.
	Err     error  `json:"-"`       // The original error. Same reason as above.
}

func (Fail) Error

func (ex Fail) Error() string

func (Fail) Unwrap

func (ex Fail) Unwrap() error

func (*Fail) WithError

func (ex *Fail) WithError(err error) *Fail

Jump to

Keyboard shortcuts

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