-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.go
More file actions
52 lines (45 loc) · 2.1 KB
/
Copy patherrors.go
File metadata and controls
52 lines (45 loc) · 2.1 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package dispatch
import "errors"
var (
// Store errors.
ErrNoStore = errors.New("dispatch: no store configured")
ErrStoreClosed = errors.New("dispatch: store closed")
ErrMigrationFailed = errors.New("dispatch: migration failed")
// Not found errors.
ErrJobNotFound = errors.New("dispatch: job not found")
ErrWorkflowNotFound = errors.New("dispatch: workflow not found")
ErrRunNotFound = errors.New("dispatch: run not found")
ErrCronNotFound = errors.New("dispatch: cron entry not found")
ErrDLQNotFound = errors.New("dispatch: dlq entry not found")
ErrEventNotFound = errors.New("dispatch: event not found")
ErrWorkerNotFound = errors.New("dispatch: worker not found")
// Conflict errors.
ErrJobAlreadyExists = errors.New("dispatch: job already exists")
ErrDuplicateCron = errors.New("dispatch: duplicate cron entry")
// State errors.
ErrInvalidState = errors.New("dispatch: invalid state transition")
ErrMaxRetriesExceeded = errors.New("dispatch: max retries exceeded")
// ErrPermanent marks a failure that retrying cannot resolve. A job
// whose handler returns an error wrapping it skips its remaining
// attempts and goes straight to the dead letter queue.
//
// Handlers wrap it to decline a retry they know is pointless:
//
// if !validPayload(p) {
// return fmt.Errorf("malformed payload: %w", dispatch.ErrPermanent)
// }
//
// The artifact plane wraps it for a missing or forbidden input, which
// is where it earns its keep: a job whose input was deleted would
// otherwise spend every attempt, and the whole backoff schedule
// between them, rediscovering that the object is still gone.
//
// Only mark a failure permanent when retrying is certain to fail the
// same way. Anything unrecognized stays retryable on purpose: a job
// retried needlessly costs some compute, while one dead-lettered by
// mistake loses work that would have succeeded.
ErrPermanent = errors.New("dispatch: permanent failure")
// Cluster errors.
ErrLeadershipLost = errors.New("dispatch: leadership lost")
ErrNotLeader = errors.New("dispatch: not the leader")
)