errors

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadRequest

func BadRequest(format string, a ...interface{}) error

func BadRequestID added in v1.2.8

func BadRequestID(id string, format string, a ...interface{}) error

func Forbidden

func Forbidden(format string, a ...interface{}) error

func ForbiddenID added in v1.2.8

func ForbiddenID(id string, format string, a ...interface{}) error

func InternalServerError

func InternalServerError(format string, a ...interface{}) error

func InternalServerErrorID added in v1.2.8

func InternalServerErrorID(id string, format string, a ...interface{}) error

func NotFound

func NotFound(format string, a ...interface{}) error

func NotFoundID added in v1.2.8

func NotFoundID(id string, format string, a ...interface{}) error

func Unauthorized

func Unauthorized(format string, a ...interface{}) error

func UnauthorizedID added in v1.2.8

func UnauthorizedID(id string, format string, a ...interface{}) error

Types

type Error

type Error struct {
	StatusCode int16
	ID, Detail string
}

func Decode

func Decode(str string) (*Error, error)

Decode tries to decode en error from a base64-encoded string

func NewError

func NewError(code int16, format string, a ...interface{}) *Error

func NewErrorID added in v1.2.8

func NewErrorID(id string, code int16, format string, a ...interface{}) *Error

func (*Error) Encode

func (e *Error) Encode() (string, error)

Encode transforms the error instance into a base64-encoded blob

func (*Error) Error

func (e *Error) Error() string

Jump to

Keyboard shortcuts

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