-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.go
More file actions
46 lines (42 loc) · 1.64 KB
/
Copy patherrors.go
File metadata and controls
46 lines (42 loc) · 1.64 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
package orca
import "fmt"
type (
InvalidDependencyError struct{ msg string }
InvalidWindowArgumentError struct{ msg string }
InvalidAlgorithmArgumentError struct{ msg string }
InvalidProcessorArgumentError struct{ msg string }
BrokenRemoteAlgorithmStubsError struct{ msg string }
InvalidAlgorithmReturnTypeError struct{ msg string }
InvalidMetadataFieldError struct{ msg string }
CompressedError struct{ errors []error }
)
func (e InvalidDependencyError) Error() string {
return fmt.Sprintf("bad metadata field - %v", e.msg)
}
func (e InvalidWindowArgumentError) Error() string {
return fmt.Sprintf("bad window argument - %v", e.msg)
}
func (e InvalidAlgorithmArgumentError) Error() string {
return fmt.Sprintf("bad algorithm argument - %v", e.msg)
}
func (e InvalidProcessorArgumentError) Error() string {
return fmt.Sprintf("bad processor argument - %v", e.msg)
}
func (e BrokenRemoteAlgorithmStubsError) Error() string {
return fmt.Sprintf("broken remote algorithm stub, rerun `orca sync` - %v", e.msg)
}
func (e InvalidAlgorithmReturnTypeError) Error() string {
return fmt.Sprintf("invalid algorithm return type - %v", e.msg)
}
func (e InvalidMetadataFieldError) Error() string {
return fmt.Sprintf("invalid metadata field - %v", e.msg)
}
func (e CompressedError) Error() string {
var compressedMsg string
for _, msg := range e.errors {
compressedMsg = fmt.Sprintf("%v\n%v", compressedMsg, "----------------------------------")
compressedMsg = fmt.Sprintf("%v\n%v", compressedMsg, msg.Error())
}
compressedMsg = fmt.Sprintf("%v\n%v\n", compressedMsg, "----------------------------------")
return compressedMsg
}