errors

package
v0.0.0-...-92998a6 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbortWithError

func AbortWithError(ctx *gin.Context, code int, err error, details string)

AbortWithError stops the chain, writes the status code and the given error

Types

type Error

type Error struct {
	Status  string `json:"status"`
	Code    int    `json:"code"`
	Message string `json:"message"`
	Details string `json:"details"`
}

func NewBadRequest

func NewBadRequest(message, details string) *Error

func NewForbiddenError

func NewForbiddenError(message, details string) *Error

func NewInternalError

func NewInternalError(err error, details string) *Error

func NewNotFoundError

func NewNotFoundError(err error, details string) *Error

func NewTooManyRequestsError

func NewTooManyRequestsError(message, details string) *Error

func NewUnauthorizedError

func NewUnauthorizedError(message, details string) *Error

func (*Error) Error

func (e *Error) Error() string

Jump to

Keyboard shortcuts

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