error

package
v0.0.0-...-1e80c8a Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(err error, ctx echo.Context)

Error implements a custom echo error handler that will encode errors as JSON objects rather than just return a text body. It will also make sure to not have the redundant information given in the echo string encoding of HTTP errors.

Types

type HTTPError

type HTTPError struct {
	Code    int    `json:"code"`
	Name    string `json:"name"`
	Message string `json:"message"`
	Cause   string `json:"cause,omitempty"`
}

HTTPError is our HTTP error definition.

Jump to

Keyboard shortcuts

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