-
Notifications
You must be signed in to change notification settings - Fork 65
/
errors.go
37 lines (30 loc) · 936 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
29
30
31
32
33
34
35
36
37
package pool
const (
errCancelled = "ERROR: Work Unit Cancelled"
errRecovery = "ERROR: Work Unit failed due to a recoverable error: '%v'\n, Stack Trace:\n %s"
errClosed = "ERROR: Work Unit added/run after the pool had been closed or cancelled"
)
// ErrRecovery contains the error when a consumer goroutine needed to be recovers
type ErrRecovery struct {
s string
}
// Error prints recovery error
func (e *ErrRecovery) Error() string {
return e.s
}
// ErrPoolClosed is the error returned to all work units that may have been in or added to the pool after it's closing.
type ErrPoolClosed struct {
s string
}
// Error prints Work Unit Close error
func (e *ErrPoolClosed) Error() string {
return e.s
}
// ErrCancelled is the error returned to a Work Unit when it has been cancelled.
type ErrCancelled struct {
s string
}
// Error prints Work Unit Cancellation error
func (e *ErrCancelled) Error() string {
return e.s
}