Documentation
¶
Overview ¶
* @FilePath: /workflow-server/pkg/errors/errors.go * @Author: maggot-code * @Date: 2023-08-14 16:15:41 * @LastEditors: maggot-code * @LastEditTime: 2023-08-16 18:02:55 * @Description:
* @FilePath: /workflow-server/pkg/errors/types.go * @Author: maggot-code * @Date: 2023-08-16 15:25:06 * @LastEditors: maggot-code * @LastEditTime: 2023-08-18 16:59:46 * @Description:
Index ¶
- Constants
- func Code(err error) int
- func IsStatusBadGateway(err error) bool
- func IsStatusBadRequest(err error) bool
- func IsStatusForbidden(err error) bool
- func IsStatusGatewayTimeout(err error) bool
- func IsStatusInternalServerError(err error) bool
- func IsStatusNotFound(err error) bool
- func IsStatusOK(err error) bool
- func IsStatusServiceUnavailable(err error) bool
- func IsStatusUnauthorized(err error) bool
- func Reason(err error) string
- type Error
- func FromError(err error) *Error
- func New(code int, reason, message string) *Error
- func Newf(code int, reason, format string, a ...interface{}) *Error
- func StatusBadGateway(reason, message string) *Error
- func StatusBadRequest(reason, message string) *Error
- func StatusForbidden(reason, message string) *Error
- func StatusGatewayTimeout(reason, message string) *Error
- func StatusInternalServerError(reason, message string) *Error
- func StatusNotFound(reason, message string) *Error
- func StatusOK(reason, message string) *Error
- func StatusServiceUnavailable(reason, message string) *Error
- func StatusUnauthorized(reason, message string) *Error
Constants ¶
View Source
const ( UnknownStatusCode = http.StatusInternalServerError UnknownStatusReason = "" )
Variables ¶
This section is empty.
Functions ¶
func IsStatusBadGateway ¶
func IsStatusBadRequest ¶
func IsStatusForbidden ¶
func IsStatusGatewayTimeout ¶
func IsStatusNotFound ¶
func IsStatusOK ¶
func IsStatusUnauthorized ¶
Types ¶
type Error ¶
type Error struct {
Status
// contains filtered or unexported fields
}
func StatusBadGateway ¶
func StatusBadRequest ¶
func StatusForbidden ¶
func StatusGatewayTimeout ¶
func StatusNotFound ¶
func StatusUnauthorized ¶
func (*Error) WithMessage ¶
func (*Error) WithReason ¶
Click to show internal directories.
Click to hide internal directories.