jsonerror

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorInternal

func ErrorInternal(c echo.Context, err error, code int) error

func ErrorInternalMap

func ErrorInternalMap(c echo.Context, err map[string]interface{}, code int) error

func ErrorInternalString

func ErrorInternalString(c echo.Context, err string, code int) error

func ErrorNotFound

func ErrorNotFound(c echo.Context, err error, code int) error

func ErrorNotFoundMap

func ErrorNotFoundMap(c echo.Context, err map[string]interface{}, code int) error

func ErrorNotFoundString

func ErrorNotFoundString(c echo.Context, err string, code int) error

func ErrorUnauthorized

func ErrorUnauthorized(c echo.Context, err error, code int) error

func ErrorUnauthorizedMap

func ErrorUnauthorizedMap(c echo.Context, err map[string]interface{}, code int) error

func ErrorUnauthorizedString

func ErrorUnauthorizedString(c echo.Context, err string, code int) error

func ErrorUnprocessableEntity

func ErrorUnprocessableEntity(c echo.Context, err error, code int) error

func ErrorUnprocessableEntityMap

func ErrorUnprocessableEntityMap(c echo.Context, err map[string]interface{}, code int) error

func ErrorUnprocessableEntityString

func ErrorUnprocessableEntityString(c echo.Context, err string, code int) error

Types

type APIError

type APIError struct {
	ID     int         `json:"id,omitempty" jsonapi:"primary,error"`
	Status int         `json:"status,omitempty" jsonapi:"attr,status"`
	Errors []ErrorData `json:"errors,omitempty" jsonapi:"attr,errors"`
	Source Source      `json:"source,omitempty" jsonapi:"attr,source"`
}

func NewError

func NewError(err error, code int, status int) *APIError

func NewErrorMap

func NewErrorMap(err map[string]interface{}, code int, status int, stack *string) *APIError

func NewErrorString

func NewErrorString(err string, code int, status int, stack *string) *APIError

type ErrorData

type ErrorData struct {
	Title  string `json:"title,omitempty" jsonapi:"attr,title"`
	Detail string `json:"detail,omitempty" jsonapi:"attr,detail"`
}

type ExceptionErr

type ExceptionErr struct {
	Inner  error
	Code   int
	Status int
}

func (*ExceptionErr) Error

func (e *ExceptionErr) Error() string

type Source

type Source struct {
	Pointer string `json:"pointer,omitempty"  jsonapi:"attr,pointer"`
}

Jump to

Keyboard shortcuts

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