httperror

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2021 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 ParseHorizonError

func ParseHorizonError(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