...
1
18
19 package scheduler
20
21 import "fmt"
22
23 type JobCannotBeScheduled struct {
24 reason string
25 }
26
27 func (e JobCannotBeScheduled) Error() string {
28 return fmt.Sprintf("Job cannot be scheduled: %s", e.reason)
29 }
30
31 type JobCannotBeForwarded struct {
32 neighborHost string
33 reason string
34 }
35
36 func (e JobCannotBeForwarded) Error() string {
37 return fmt.Sprintf("Job cannot be forwarded to neighbor %s: %s", e.neighborHost, e.reason)
38 }
39
40 type PeerResponseNil struct {
41 neighborHost string
42 }
43
44 func (e PeerResponseNil) Error() string {
45 return fmt.Sprintf("Peer %s response is nil", e.neighborHost)
46 }
47
48 type JobDeliberatelyRejected struct {
49 }
50
51 func (e JobDeliberatelyRejected) Error() string {
52 return fmt.Sprintf("Job has been deliberately rejected")
53 }
54
55 type CannotChangeScheduler struct{}
56
57 func (e CannotChangeScheduler) Error() string {
58 return "SchedulerDescriptor cannot be changed right now"
59 }
60
61 type CannotRetrieveAction struct {
62 err error
63 }
64
65 func (e CannotRetrieveAction) Error() string {
66 return fmt.Sprintf("The action to be taken cannot be retrieved: %s", e.err)
67 }
68
69 type CannotRetrieveRecipientNode struct {
70 err error
71 }
72
73 func (e CannotRetrieveRecipientNode) Error() string {
74 return fmt.Sprintf("The recipient node cannot be retrieved: %s", e.err)
75 }
76
77 type BadSchedulerParameters struct{}
78
79 func (e BadSchedulerParameters) Error() string {
80 return "Bad passed parameters for scheduler"
81 }
82
View as plain text