httperr

package
v0.0.0-...-273060c Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2020 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrCode

func ErrCode(err error) int

func New

func New(code int, msg string) error

func Wrap

func Wrap(err error, code int, msg string) error

func Wrapf

func Wrapf(err error, code int, f string, v ...interface{}) error

func WriteErr

func WriteErr(w http.ResponseWriter, err error) error

WriteErr writes the error code into the status and body.

Types

type JSONError

type JSONError struct {
	Error string `json:"error"`
}

type StatusCoder

type StatusCoder interface {
	StatusCode() int
}

Jump to

Keyboard shortcuts

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