errors

package
v0.0.0-...-acb99ff Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnauthorized        = &apiError{status: http.StatusUnauthorized, msg: "invalid token"}
	ErrNotFound            = &apiError{status: http.StatusNotFound, msg: "not found"}
	ErrBadRequest          = &apiError{status: http.StatusBadRequest, msg: "bad request"}
	ErrInternalServerError = &apiError{status: http.StatusInternalServerError, msg: "internal server error"}
)

Functions

func HandleErrorJSON

func HandleErrorJSON(c *gin.Context, err error)

func WrapError

func WrapError(err error, apiError *apiError) error

Types

type APIError

type APIError interface {
	APIError() (int, string)
}

Jump to

Keyboard shortcuts

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