-
Notifications
You must be signed in to change notification settings - Fork 85
/
evalnotfound.go
64 lines (53 loc) · 1.34 KB
/
evalnotfound.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package bacerrors
import (
"fmt"
)
type EvaluationNotFound GenericError
func NewEvaluationNotFound(id string) *EvaluationNotFound {
var e EvaluationNotFound
e.Code = ErrorCodeEvaluationNotFound
e.Message = fmt.Sprintf(ErrorMessageEvaluationNotFound, id)
e.Details = make(map[string]interface{})
e.Details["id"] = id
e.SetID(id)
e.SetError(fmt.Errorf("%s", e.Message))
return &e
}
func (e *EvaluationNotFound) GetMessage() string {
return e.Message
}
func (e *EvaluationNotFound) SetMessage(s string) {
e.Message = s
}
func (e *EvaluationNotFound) Error() string {
return e.GetError().Error()
}
func (e *EvaluationNotFound) GetError() error {
return e.Err
}
func (e *EvaluationNotFound) SetError(err error) {
e.Err = err
}
func (e *EvaluationNotFound) GetCode() string {
return ErrorCodeJobNotFound
}
func (e *EvaluationNotFound) SetCode(string) {
e.Code = ErrorCodeJobNotFound
}
func (e *EvaluationNotFound) GetDetails() map[string]interface{} {
return e.Details
}
func (e *EvaluationNotFound) GetID() string {
if id, ok := e.Details["id"]; ok {
return id.(string)
}
return ""
}
func (e *EvaluationNotFound) SetID(s string) {
e.Details["id"] = s
}
const (
ErrorCodeEvaluationNotFound = "error-evaluation-not-found"
ErrorMessageEvaluationNotFound = "Evaluation not found. ID: %s"
)
var _ BacalhauErrorInterface = (*EvaluationNotFound)(nil)