errors

package
v0.0.0-...-a7e37d3 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadRequest

func BadRequest(c echo.Context, err error) error

func ErrorFormat

func ErrorFormat(err error) map[string]string

func NewErrorBind

func NewErrorBind(err error) error

func NotFound

func NotFound(c echo.Context, err error) error

Types

type Bind

type Bind int
const (
	Expected Bind = iota
	Got
	Field
	Offset
	Error
)

func (Bind) String

func (b Bind) String() string

type BindError

type BindError struct {
	Expected     string
	Got          string
	Field        string
	Offset       string
	ErrorMessage string
	Type         BindErrorType
}

func ConvertHttpErrorToBindError

func ConvertHttpErrorToBindError(httpErr *echo.HTTPError) (*BindError, error)

func (BindError) ToString

func (b BindError) ToString() string

type BindErrorType

type BindErrorType int
const (
	ErrTypeUndefined BindErrorType = iota
	ErrTypeSyntax
	ErrTypeMarshal
)

func (BindErrorType) GetType

func (b BindErrorType) GetType(s string) BindErrorType

func (BindErrorType) IsDefined

func (b BindErrorType) IsDefined() bool

Jump to

Keyboard shortcuts

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