weberrors

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2021 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPStatusCode

func HTTPStatusCode(e error) (statusCode int, cause error)

func WithMessage

func WithMessage(e error, headline, message string) error

WithMessage wraps an internal error with a user-facing message

Types

type HTTPError

type HTTPError interface {
	error
	HTTPStatus() int
}

func WithStatus

func WithStatus(e error, c int) HTTPError

type Redirector

type Redirector interface {
	error
	RedirectLocation() string
}

type UserError

type UserError interface {
	error
	Headline() string
	Message() string
}

A UserError is an error that may be shown to end users

Jump to

Keyboard shortcuts

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