-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.go
More file actions
73 lines (58 loc) · 2.97 KB
/
Copy patherrors.go
File metadata and controls
73 lines (58 loc) · 2.97 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package portal
import (
"fmt"
)
var (
// ErrorInternallyHandled indicates that a real error does not exist, but a cancel was necessary somewhere in the portal.
ErrorInternallyHandled = fmt.Errorf("\x00")
ErrorListMultipleSplitters = fmt.Errorf("list: cannot use multiple splitters")
ErrorListNoSplitters = fmt.Errorf("list: no splitter was found")
ErrorFeatureListCannotCombineExcludeInclude = fmt.Errorf("features: cannot combine exclude and include lists!")
ErrorCommandListCannotCombineExcludeInclude = fmt.Errorf("commands: cannot combine exclude and include lists!")
)
func Errors(errs ...error) []error {
return errs
}
// ErrorRuntimeExists indicates that a portal runtime already exists which matches the given portal ID.
func ErrorRuntimeExists(portalID string) error {
return fmt.Errorf("portal: runtime already exists: %s", portalID)
}
// ErrorEventArgNotFound indicates that an event argument was not found when processing a given command.
func ErrorEventArgNotFound(field string) error {
return fmt.Errorf("event: argument: not found: %s", field)
}
// ErrorEventArgInvalidValue indicates that an event argument was found invalid when processing a given command.
func ErrorEventArgInvalidValue(field string) error {
return fmt.Errorf("event: argument: invalid value: %s", field)
}
// ErrorFeatureNotFound indicates that a feature with the given ID was not found in the portal network.
func ErrorFeatureNotFound(featureID string) error {
return fmt.Errorf("feature: not found: %s", featureID)
}
// ErrorFeatureExists indicates that a feature with the given ID already exists somewhere in the portal network.
func ErrorFeatureExists(featureID string) error {
return fmt.Errorf("feature: already exists: %s", featureID)
}
func ErrorFeatureAPI(featureID string, featureAPI, portalAPI int) error {
return fmt.Errorf("feature: mismatched API %d with portal API %d: %s", featureAPI, portalAPI, featureID)
}
// ErrorFeatureThreadAlreadyRunning indicates that a feature's transport thread is already running.
func ErrorFeatureThreadAlreadyRunning(featureID string) error {
return fmt.Errorf("feature: thread already running: %s", featureID)
}
// ErrorFeatureAlreadyOpen indicates that a feature is already open.
func ErrorFeatureAlreadyOpen(featureID string) error {
return fmt.Errorf("feature: already open: %s", featureID)
}
// ErrorFeatureAlreadyClosed indicates that a feature is already closed.
func ErrorFeatureAlreadyClosed(featureID string) error {
return fmt.Errorf("feature: already closed: %s", featureID)
}
// ErrorFeatureNotOpen indicates that a feature is not open for operations.
func ErrorFeatureNotOpen(featureID string) error {
return fmt.Errorf("feature: not open: %s", featureID)
}
// ErrorFeatureNotReady indicates that a feature is not ready to ingest the network.
func ErrorFeatureNotReady(featureID string) error {
return fmt.Errorf("feature: not ready: %s", featureID)
}