customerror

package
v0.0.0-...-533f09b Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Default  = "default"
	Request  = "request"
	Parsing  = "parsing"
	Database = "database"

	GenericErrorMessage = "Something went wrong"
)

Variables

This section is empty.

Functions

func HandleStatus

func HandleStatus(err CustomError) int

func NewDbError

func NewDbError(from interface{}, query string, err error) error

func NewError

func NewError(from interface{}, complement string, err error) error

func NewParsingError

func NewParsingError(from interface{}, err error) error

func NewRequestError

func NewRequestError(from interface{}, err error, url string, statusCode int) error

Types

type CustomError

type CustomError interface {
	Error() string
	GetErrType() string
	GetExtraInfo() map[string]interface{}
	GetMessage() string
}

type Error

type Error struct {
	// contains filtered or unexported fields
}

func (*Error) Error

func (c *Error) Error() string

func (*Error) GetErrType

func (c *Error) GetErrType() string

func (*Error) GetExtraInfo

func (c *Error) GetExtraInfo() map[string]interface{}

func (*Error) GetMessage

func (c *Error) GetMessage() string

Jump to

Keyboard shortcuts

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