httperrors

package
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBErrorMessage

func DBErrorMessage(err error) (int, string)

DBErrorMessage returns an error message and status code appropriate to the error that has occurred.

func Handler

func Handler(c *gin.Context, err error, notFoundMsg ...string)

Handler handles errors for fetching data from the database.

func InvalidMonth

func InvalidMonth(c *gin.Context)

func InvalidQueryString

func InvalidQueryString(c *gin.Context)

func InvalidUUID

func InvalidUUID(c *gin.Context)

func New

func New(c *gin.Context, status int, msgAndArgs ...any)

Generate a struct containing the HTTP error on the fly.

Types

type HTTPError

type HTTPError struct {
	Error string `json:"error" example:"An ID specified in the query string was not a valid uint64"`
}

Jump to

Keyboard shortcuts

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