myerr

package
v0.0.0-...-1f9b127 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPStatus

func HTTPStatus(err error) int

HTTPStatus returns the HTTP status included in err. If err is nil, this function returns 0. If err is non-nil, and does not include an HTTP status, a default value of net/http.StatusInternalServerError is returned.

func WithHTTPStatus

func WithHTTPStatus(err error, status int) error

WithHTTPStatus returns an error with the given HTTP status code. If err is nil, this function returns nil. If err is non-nil, and does not include an HTTP status, a new error is returned with the given status code.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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