errorhandler

package
v0.0.0-...-a45d15d Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAuthFailed             = errors.New("access denied to this resource")
	ErrPermFailed             = errors.New("invalid permissions to this resource")
	ErrBindingFailed          = errors.New("cannot bind the request data")
	ErrValidationFailed       = errors.New("cannot validate the request data")
	ErrDocumentNotFound       = errors.New("cannot find the document")
	ErrDocumentsNotFound      = errors.New("cannot find all documents")
	ErrDocumentNotCreate      = errors.New("cannot create the document")
	ErrDocumentNotUpdate      = errors.New("cannot update the document")
	ErrDocumentNotDelete      = errors.New("cannot delete the document")
	ErrMultipleDocumentsFound = errors.New("find multiple documents, but only one was expected")
	ErrRequestFailed          = errors.New("request failed")
	ErrRequestsLimitExceeded  = errors.New("limit of requests exceeded")
	ErrInactivityTimeout      = errors.New("inactivity timeout reached")
)

Functions

func NewErrorStatusCodeMaps

func NewErrorStatusCodeMaps() map[error]int

Types

type HttpErrorHandler

type HttpErrorHandler struct {
	// contains filtered or unexported fields
}

func New

func New(errorStatusCodeMaps map[error]int) *HttpErrorHandler

New creates a new HttpErrorHandler

func (*HttpErrorHandler) Handler

func (h *HttpErrorHandler) Handler(err error, c echo.Context)

Handler handles the error and sends the response to the client

Jump to

Keyboard shortcuts

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