forked from RichardKnop/machinery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors.go
28 lines (22 loc) · 971 Bytes
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package errs
import (
"errors"
"fmt"
)
// ErrCouldNotUnmarshalTaskSignature ...
type ErrCouldNotUnmarshalTaskSignature struct {
msg []byte
reason string
}
// Error implements the error interface
func (e ErrCouldNotUnmarshalTaskSignature) Error() string {
return fmt.Sprintf("Could not unmarshal '%s' into a task signature: %v", e.msg, e.reason)
}
// NewErrCouldNotUnmarshalTaskSignature returns new ErrCouldNotUnmarshalTaskSignature instance
func NewErrCouldNotUnmarshalTaskSignature(msg []byte, err error) ErrCouldNotUnmarshalTaskSignature {
return ErrCouldNotUnmarshalTaskSignature{msg: msg, reason: err.Error()}
}
// ErrConsumerStopped indicates that the operation is now illegal because of the consumer being stopped.
var ErrConsumerStopped = errors.New("the server has been stopped")
// ErrStopTaskDeletion indicates that the task should not be deleted from source after task failure
var ErrStopTaskDeletion = errors.New("task should not be deleted")