Discover Packages
github.com/tgulacsi/go
httperr
package
Version:
v0.20.1
Opens a new window with list of versions in this module.
Published: Apr 23, 2022
License: Apache-2.0
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package httperr provides a small helper for returning statuscode-accompanied errors.
func New(err error , code int ) *httpError
New returns a new error with the specified error and StatusCode.
If code is zero, http.StatusInternalServerError is used.
If err is nil, a new error is created from the status code.
func Newf(code int , msg string , args ...interface{}) *httpError
Newf returns a new httpError with the given code,
and the message is created from msg and the args.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.