Documentation
¶
Index ¶
- func DbErrorToRequestError(req interface{}, err error, dbType string) (error, bool)
- type RequestError
- func NewBadRequestErrorf(req interface{}, format string, v ...any) RequestError
- func NewDataTooLongErrorf(req interface{}, format string, v ...any) RequestError
- func NewNotFoundErrorf(req interface{}, format string, v ...any) RequestError
- func NewPkConflictErrorf(req interface{}, format string, v ...any) RequestError
- func NewRequestErrorf(code int, req interface{}, format string, v ...any) RequestError
- type ServiceError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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
Click to show internal directories.
Click to hide internal directories.