gwerror

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DbErrorToRequestError

func DbErrorToRequestError(req interface{}, err error, dbType string) (error, bool)

Types

type RequestError

type RequestError struct {
	Code    int    `json:"-"`
	Message string `json:"message"`
	ReqBody string `json:"reqBody,omitempty"`
}

func NewBadRequestErrorf

func NewBadRequestErrorf(req interface{}, format string, v ...any) RequestError

func NewDataTooLongErrorf

func NewDataTooLongErrorf(req interface{}, format string, v ...any) RequestError

func NewNotFoundErrorf

func NewNotFoundErrorf(req interface{}, format string, v ...any) RequestError

func NewPkConflictErrorf

func NewPkConflictErrorf(req interface{}, format string, v ...any) RequestError

func NewRequestErrorf

func NewRequestErrorf(code int, req interface{}, format string, v ...any) RequestError

func (RequestError) Error

func (e RequestError) Error() string

type ServiceError

type ServiceError struct {
	Code    int    `json:"-"`
	Message string `json:"message"`
	ReqBody string `json:"reqBody,omitempty"`
	Err     error  `json:"err"`
}

func WrapServiceErrorf

func WrapServiceErrorf(err error, req interface{}, format string, v ...any) ServiceError

func (ServiceError) Error

func (e ServiceError) Error() string

Jump to

Keyboard shortcuts

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