Documentation
¶
Index ¶
- Variables
- func New400Response(msg string, args ...interface{}) error
- func New500Response(msg string, args ...interface{}) error
- func NewResponse(code, statusCode int, msg string, args ...interface{}) error
- func Wrap400Response(err error, msg string, args ...interface{}) error
- func Wrap500Response(err error, msg string, args ...interface{}) error
- func WrapResponse(err error, code, statusCode int, msg string, args ...interface{}) error
- type ResponseError
Constants ¶
This section is empty.
Variables ¶
View Source
var ( New = errors.New Wrap = errors.Wrap Wrapf = errors.Wrapf WithStack = errors.WithStack WithMessage = errors.WithMessage WithMessagef = errors.WithMessagef )
View Source
var ( ErrBadRequest = New400Response("ErrBadRequest") ErrInvalidParent = New400Response("ErrInvalidParent") ErrNotAllowDeleteWithChild = New400Response("ErrNotAllowDeleteWithChild") ErrNotAllowDelete = New400Response("ErrNotAllowDelete") ErrInvalidUserName = New400Response("ErrInvalidUserName") ErrInvalidPassword = New400Response("ErrInvalidPassword") ErrInvalidUser = New400Response("ErrInvalidUser") ErrUserDisable = New400Response("ErrUserDisable") ErrNoPerm = NewResponse(401, 401, "ErrNoPerm") ErrInvalidToken = NewResponse(9999, 401, "ErrInvalidToken") ErrNotFound = NewResponse(404, 404, "ErrNotFound") ErrMethodNotAllow = NewResponse(405, 405, "ErrMethodNotAllow") ErrTooManyRequests = NewResponse(429, 429, "ErrTooManyRequests") ErrInternalServer = NewResponse(500, 500, "ErrInternalServer") )
Functions ¶
func New400Response ¶
func New500Response ¶
func NewResponse ¶
func Wrap400Response ¶
func Wrap500Response ¶
Types ¶
type ResponseError ¶
func UnWrapResponse ¶
func UnWrapResponse(err error) *ResponseError
func (*ResponseError) Error ¶
func (r *ResponseError) Error() string
Click to show internal directories.
Click to hide internal directories.