errors

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: MIT Imports: 6 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 Forbidden

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

func InternalServerError

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

func NewError

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

func NotFound

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

func Unauthorized

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

Types

type Error

type Error struct {
	StatusCode int16
	Detail     string
}

func Decode

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

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

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