Documentation
¶
Index ¶
- func Is(err, target error) bool
- func IsStatus(err error, status int) bool
- func RequestError(err error, code int) error
- func ResponseError(err error, code int) error
- type AppError
- func AsAppError(err error) AppError
- func BadRequestf(format string, args ...any) AppError
- func Errorf(format string, args ...interface{}) AppError
- func Forbiddenf(format string, args ...interface{}) AppError
- func New(msg string) AppError
- func NotFoundf(format string, args ...interface{}) AppError
- func Wrap(err error, msg ...string) AppError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RequestError ¶
func ResponseError ¶
Types ¶
type AppError ¶
type AppError interface {
Error() string
Unwrap() error
Format(s fmt.State, v rune)
FormatError(p xerrors.Printer) error
AddData(field string, data interface{}) AppError
BadRequest() AppError
NotFound() AppError
InternalServerError() AppError
New(msg ...string) AppError
Errorf(format string, args ...interface{}) AppError
Wrap(err error, msg ...string) AppError
Code() int
Status() int
Is(err error) bool
IsStatus(status int) bool
}
func AsAppError ¶
func BadRequestf ¶
func Forbiddenf ¶
Click to show internal directories.
Click to hide internal directories.