herr

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: ISC Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToHttpCode

func ToHttpCode(err error, defaultStatus int) int

ToHttpCode returns a status code indicated by an HttpError or a default status if the error is not an HttpError instance

Types

type HttpError

type HttpError struct {
	// contains filtered or unexported fields
}

HttpError represents an error that indicates an HTTP status

func NewFromError added in v0.9.0

func NewFromError(err error, status int) HttpError

func NewFromString added in v0.9.0

func NewFromString(msg string, status int) HttpError

func (*HttpError) Unwrap added in v0.10.0

func (he *HttpError) Unwrap() error

Jump to

Keyboard shortcuts

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