-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.go
More file actions
39 lines (30 loc) · 779 Bytes
/
Copy patherrors.go
File metadata and controls
39 lines (30 loc) · 779 Bytes
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
package main
import (
"fmt"
"strings"
)
type ErrCommandNotDefined struct {
Task string
}
func (e *ErrCommandNotDefined) Error() string {
return fmt.Sprintf("command for task '%s' is not defined", e.Task)
}
type ErrDependencyNotFound struct {
Task string
Dependency string
}
func (e *ErrDependencyNotFound) Error() string {
return fmt.Sprintf("dependency '%s' for task '%s' not found", e.Dependency, e.Task)
}
type ErrSelfDependency struct {
Task string
}
func (e *ErrSelfDependency) Error() string {
return fmt.Sprintf("task '%s' cannot depend on itself", e.Task)
}
type ErrCyclicDependency struct {
Path []string
}
func (e *ErrCyclicDependency) Error() string {
return fmt.Sprintf("cyclic dependency detected: %s", strings.Join(e.Path, " ──> "))
}