errors

package
v0.0.0-...-8fe00be Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2023 License: MIT Imports: 3 Imported by: 0

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

View Source
const (
	UnknownStatusCode   = http.StatusInternalServerError
	UnknownStatusReason = ""
)

Variables

This section is empty.

Functions

func Code

func Code(err error) int

func IsStatusBadGateway

func IsStatusBadGateway(err error) bool

func IsStatusBadRequest

func IsStatusBadRequest(err error) bool

func IsStatusForbidden

func IsStatusForbidden(err error) bool

func IsStatusGatewayTimeout

func IsStatusGatewayTimeout(err error) bool

func IsStatusInternalServerError

func IsStatusInternalServerError(err error) bool

func IsStatusNotFound

func IsStatusNotFound(err error) bool

func IsStatusOK

func IsStatusOK(err error) bool

func IsStatusServiceUnavailable

func IsStatusServiceUnavailable(err error) bool

func IsStatusUnauthorized

func IsStatusUnauthorized(err error) bool

func Reason

func Reason(err error) string

Types

type Error

type Error struct {
	Status
	// contains filtered or unexported fields
}

func FromError

func FromError(err error) *Error

func New

func New(code int, reason, message string) *Error

func Newf

func Newf(code int, reason, format string, a ...interface{}) *Error

func StatusBadGateway

func StatusBadGateway(reason, message string) *Error

func StatusBadRequest

func StatusBadRequest(reason, message string) *Error

func StatusForbidden

func StatusForbidden(reason, message string) *Error

func StatusGatewayTimeout

func StatusGatewayTimeout(reason, message string) *Error

func StatusInternalServerError

func StatusInternalServerError(reason, message string) *Error

func StatusNotFound

func StatusNotFound(reason, message string) *Error

func StatusOK

func StatusOK(reason, message string) *Error

func StatusServiceUnavailable

func StatusServiceUnavailable(reason, message string) *Error

func StatusUnauthorized

func StatusUnauthorized(reason, message string) *Error

func (*Error) Error

func (e *Error) Error() string

func (*Error) Is

func (e *Error) Is(err error) bool

func (*Error) Unwrap

func (e *Error) Unwrap() error

func (*Error) WithCause

func (e *Error) WithCause(cause error) *Error

func (*Error) WithMessage

func (e *Error) WithMessage(message string) *Error

func (*Error) WithReason

func (e *Error) WithReason(reason string) *Error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL