httpErrors

package
v0.0.0-...-9d4efbb Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InternalServerError = errors.New("Internal Server Error")
	NotFound            = errors.New("Not Found")
	RequestTimeoutError = errors.New("Request Timeout")
	CannotBindGivenData = errors.New("Could not bind given data")
	ValidationError     = errors.New("Validation failed for given payload")
	UniqueError         = errors.New("Item should be unique on database")
)

Functions

func ErrorResponse

func ErrorResponse(err error) (int, interface{})

Types

type RestErr

type RestErr interface {
	Status() int
	Error() string
	Causes() interface{}
}

func NewInternalServerError

func NewInternalServerError(causes interface{}) RestErr

func NewRestError

func NewRestError(status int, err string, causes interface{}) RestErr

func ParseErrors

func ParseErrors(err error) RestErr

type RestError

type RestError APIResponse

func (RestError) Causes

func (e RestError) Causes() interface{}

func (RestError) Error

func (e RestError) Error() string

func (RestError) Status

func (e RestError) Status() int

Jump to

Keyboard shortcuts

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