Documentation
¶
Index ¶
Constants ¶
View Source
const ( ExitSuccess = iota ExitError ExitBadArgs = 128 )
linux保留退出代码
Variables ¶
View Source
var ( ErrRunFuncNotFound = errors.New("worker: workFunc not found") ErrAttemptExhausted = errors.New("worker: the number of attempts is exhausted") ErrCtxCanceled = errors.New("worker: context canceled") ErrCtxDeadlineExceeded = errors.New("worker: context deadlineExceeded") ErrHandlerMostBePtr = errors.New("worker:handler must be a pointer type") ErrInvalidCron = errors.New("worker:invalid cronSchedule") ErrClusterRegister = errors.New("worker:cluster register exception") ErrClusterUnRegister = errors.New("worker:cluster unregister exception") ErrClusterBuild = errors.New("worker:cluster build exception") ErrClusterRegisterInfoNotFound = errors.New("worker:cluster register info not found") )
View Source
var ( // ErrTryAgain 表示函数立即重试 ErrTryAgain = errors.New("worker: [not error] func rey again") )
Functions ¶
func ContextErr ¶
func ExitWithError ¶
func WithErrorMessage ¶
Types ¶
type WorkerError ¶
type WorkerError struct { Inner interface{} Type ErrorType Message string Stack string Data interface{} }
func WrapError ¶
func WrapError(err interface{}, typ ErrorType, messagef string, msgArgs ...interface{}) WorkerError
func (WorkerError) Error ¶
func (e WorkerError) Error() string
func (*WorkerError) IsType ¶
func (e *WorkerError) IsType(t ErrorType) bool
func (*WorkerError) SetData ¶
func (e *WorkerError) SetData(data interface{})
func (*WorkerError) SetStack ¶
func (e *WorkerError) SetStack(stack string)
Click to show internal directories.
Click to hide internal directories.