errs

package
v0.0.0-...-344413b Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorHandler

func ErrorHandler(c *fiber.Ctx, err error) error

Types

type APIError

type APIError struct {
	StatusCode int `json:"statusCode"`
	Message    any `json:"msg"`
}

func BadRequest

func BadRequest(err error) APIError

func Conflict

func Conflict(title string, withKey string, withValue any) APIError

func InternalServerError

func InternalServerError() APIError

func InvalidJSON

func InvalidJSON() APIError

func InvalidRequestData

func InvalidRequestData(errors map[string]string) APIError

func NewAPIError

func NewAPIError(statusCode int, err error) APIError

func NotFound

func NotFound(title string, withKey string, withValue any) APIError

func (APIError) Error

func (e APIError) Error() string

Jump to

Keyboard shortcuts

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