errorutilities

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidUUID     = NewInvalidUUIDError()
	ErrNotFound        = NewNotFoundError("resource")
	ErrFieldUnexported = NewError("field is unexported, can't get it's value")
	ErrDataNotStruct   = NewError("data isn't struct")
	ErrFieldNotInt     = NewError("field isn't type int, int8, int16, int32 or int64")
	ErrFieldNotUInt    = NewError("field isn't type uint, uint8, uint16, uint32 or uint64")
	ErrFieldNotString  = NewError("field isn't type string")
	ErrNotPointer      = NewError("destination should be pointer or else changes won't reflect on it")
)

Functions

This section is empty.

Types

type Error

type Error struct {
	Message string `json:"error"`
	Status  int    `json:"-"`
}

func NewBadRequestError

func NewBadRequestError(message string) Error

func NewError

func NewError(message string, status ...int) Error

func NewErrorf

func NewErrorf(pattern string, args ...any) Error

func NewInvalidUUIDError

func NewInvalidUUIDError() Error

func NewNotFoundError

func NewNotFoundError(resource string) Error

func NewUnexportedFieldError

func NewUnexportedFieldError(fieldName string) Error

func NewValidationError

func NewValidationError(errors validator.ValidationErrors) 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