Versions in this module Expand all Collapse all v0 v0.1.0 Dec 3, 2019 Changes in this version + var ErrBadRequest = New400Response("Request error") + var ErrInternalServer = NewResponse(500, "Server error", 500) + var ErrInvalidParent = New400Response("Invalid parent node") + var ErrInvalidPassword = New400Response("Invalid password") + var ErrInvalidToken = NewResponse(9999, "Token invalidation", 401) + var ErrInvalidUser = New400Response("Invalid user") + var ErrInvalidUserName = New400Response("Invalid username") + var ErrMethodNotAllow = NewResponse(405, "Method is not allowed", 405) + var ErrNoPerm = NewResponse(401, "No access", 401) + var ErrNotAllowDelete = New400Response("Resources are not allowed to delete") + var ErrNotAllowDeleteWithChild = New400Response("Contains children, cannot be deleted") + var ErrNotFound = NewResponse(404, "Resource does not exist.", 404) + var ErrTooManyRequests = NewResponse(429, "Request too frequently", 429) + var ErrUserDisable = New400Response("User is disabled, please contact administrator") + var New = errors.New + var WithMessage = errors.WithMessage + var WithStack = errors.WithStack + var Wrap = errors.Wrap + var Wrapf = errors.Wrapf + func New400Response(msg string) error + func New500Response(msg string) error + func NewResponse(code int, msg string, status ...int) error + func Wrap400Response(err error, msg ...string) error + func Wrap500Response(err error, msg ...string) error + func WrapResponse(err error, code int, msg string, status ...int) error + type ResponseError struct + Code int + ERR error + Message string + StatusCode int + func UnWrapResponse(err error) *ResponseError + func (r *ResponseError) Error() string