-
Notifications
You must be signed in to change notification settings - Fork 4
/
errors.go
30 lines (28 loc) · 1.84 KB
/
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
29
30
package pipeline
import "errors"
var (
// ErrShutdown is an error returned when the shutdown doesn't finishes before
// the given context is closed.
ErrShutdown = errors.New("shutdown didn't finished as expected")
// ErrEndpointNil is an error returned when the endpoint is nil.
ErrEndpointNil = errors.New("endpoint is nil")
// ErrEmptyInputStreamOrMessagePool is an error returned when the streams and the message pool a nil or empty slices.
ErrEmptyInputStreamOrMessagePool = errors.New("input streams and message pool are nil or empty")
//ErrBothInputSet is an error returned if both input stream and message pool are set. Only one is allowed.
ErrBothInputSet = errors.New("input streams and message pool cannot be set simultaneously")
// ErrNilDecoders is an error returned when both decoders are nil.
ErrNilDecoders = errors.New("decoder and batch decoder are both nil")
// ErrBothDecodersSet is an error returned when both decoders are set. Only one is allowed.
ErrBothDecodersSet = errors.New("decoder and batch decoder cannot be set simultaneously")
// ErrBatchSizeInvalid is an error returned when the batch size is less than 1.
ErrBatchSizeInvalid = errors.New("invalid batch size")
// ErrSinkNil is an error returned when the sink is not set.
ErrSinkNil = errors.New("sink is nil")
// ErrSinkEncoderNil is an error returned when the sink encoder is not set.
ErrSinkEncoderNil = errors.New("sink encoder is nil")
// ErrSystemNameEmpty is an error returned when the system name is empty.
ErrSystemNameEmpty = errors.New("system name is empty")
// ErrInfiniteBehavior is an error returned when the DLQ is active but max retries is set as infinite.
// This may cause an infinite loop if the returned service error with wright severity was not SeverityInput type.
ErrInfiniteBehavior = errors.New("DLQ is active but max retries is set as infinite")
)