errors

package
v0.0.0-...-23ef0f1 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAuth       = &ticketAPIError{status: http.StatusUnauthorized, msg: "invalid token"}
	ErrNotFound   = &ticketAPIError{status: http.StatusNotFound, msg: "not found"}
	ErrUUDInvalid = &ticketAPIError{status: http.StatusBadRequest, msg: "invalid UUID"}
	ErrDuplicate  = &ticketAPIError{status: http.StatusBadRequest, msg: "duplicate"}
)

Functions

func JSONHandleError

func JSONHandleError(w http.ResponseWriter, err error)

Types

type APIError

type APIError interface {
	// APIError returns an HTTP status code and an API-safe error message.
	APIError() (int, string)
}

Jump to

Keyboard shortcuts

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