forked from meshery/meshkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.go
More file actions
42 lines (38 loc) · 1.28 KB
/
Copy pathtypes.go
File metadata and controls
42 lines (38 loc) · 1.28 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
package errors
type (
Error struct {
Code string
Severity Severity
ShortDescription []string
LongDescription []string
ProbableCause []string
SuggestedRemediation []string
}
// Limitations of Error struct defined above:
// There are different types of Errors. Each type of error contains different information.
// Short and Long Descriptions accept only strings and so they cannot contain structured information.
// e.g. The Validation Error information (instancePath, badValue etc.) cannot be contained in Error struct (or not in a structured way that the clients can make use of it)
//
// ErrorV2 struct adds the ability to express all different types of errors.
// ErrorV2 is backwards compatible with Error struct
ErrorV2 struct {
Code string
Severity Severity
ShortDescription []string
LongDescription []string
ProbableCause []string
SuggestedRemediation []string
AdditionalInfo interface{}
}
)
type Severity int
const (
Emergency = iota // System unusable
None // None severity
Alert // Immediate action needed
Critical // Critical condition—default level
Fatal // Fatal condition
)
var (
NoneString = []string{"None"}
)