customError

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

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

Go to latest
Published: Feb 25, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsBadRequestError

func IsBadRequestError(e error) bool

func IsCustomError

func IsCustomError(err error) bool

func IsInternalServerError

func IsInternalServerError(e error) bool

func IsNotFoundError

func IsNotFoundError(e error) bool

func IsValidationError

func IsValidationError(e error) bool

func NewBadRequestError

func NewBadRequestError(message string, code int, details map[string]string) error

func NewBadRequestErrorWrap

func NewBadRequestErrorWrap(err error, message string, code int, details map[string]string) error

func NewInternalServerError

func NewInternalServerError(message string, code int, details map[string]string) error

func NewInternalServerErrorWrap

func NewInternalServerErrorWrap(err error, message string, code int, details map[string]string) error

func NewNotFoundError

func NewNotFoundError(message string, code int, details map[string]string) error

func NewNotFoundErrorWrap

func NewNotFoundErrorWrap(err error, message string, code int, details map[string]string) error

func NewValidationError

func NewValidationError(message string, code int, details map[string]string) error

func NewValidationErrorWrap

func NewValidationErrorWrap(err error, message string, code int, details map[string]string) error

Types

type BadRequestError

type BadRequestError interface {
	CustomError
	IsBadRequestError() bool
}

type CustomError

type CustomError interface {
	error
	IsCustomError() bool
	Message() string
	Code() int
	Details() map[string]string
}

func AsCustomError

func AsCustomError(err error) CustomError

func NewCustomError

func NewCustomError(err error, internalCode int, message string, details map[string]string) CustomError

type InternalServerError

type InternalServerError interface {
	CustomError
	IsInternalServerError() bool
}

type NotFoundError

type NotFoundError interface {
	CustomError
	IsNotFoundError() bool
}

type ValidationError

type ValidationError interface {
	BadRequestError
	IsValidationError() bool
}

Jump to

Keyboard shortcuts

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