httperror

package
v0.0.0-...-55f7a6b Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BadRequest = &Error{
	ErrorMessage: "The request was invalid in some way.",
	Status:       http.StatusBadRequest,
}
View Source
var InternalServer = &Error{
	ErrorMessage: "An error occurred while processing this request.",
	Status:       http.StatusInternalServerError,
}

Functions

func ParseFrontierError

func ParseFrontierError(err error) error

Types

type Error

type Error struct {
	ErrorMessage string `json:"error"`
	Status       int    `json:"-"`
}

func NewHTTPError

func NewHTTPError(status int, errorMessage string) *Error

func (*Error) Error

func (h *Error) Error() string

func (*Error) Render

func (e *Error) Render(w http.ResponseWriter)

Jump to

Keyboard shortcuts

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