httperr

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package httperr provides a small helper for returning statuscode-accompanied errors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

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

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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