-
Notifications
You must be signed in to change notification settings - Fork 1
/
errors.go
53 lines (40 loc) · 1.03 KB
/
errors.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
package oniontree
import "fmt"
type ErrNotOnionTree struct {
dir string
}
func (e *ErrNotOnionTree) Error() string {
return fmt.Sprintf("directory `%s` is not an OnionTree repository", e.dir)
}
type ErrIdExists struct {
id string
}
func (e *ErrIdExists) Error() string {
return fmt.Sprintf("service with ID `%s` already exists", e.id)
}
type ErrIdNotExists struct {
id string
}
func (e *ErrIdNotExists) Error() string {
return fmt.Sprintf("service with ID `%s` does not exist", e.id)
}
type ErrTagNotExists struct {
tag Tag
}
func (e *ErrTagNotExists) Error() string {
return fmt.Sprintf("tag with name `%s` does not exist", e.tag)
}
type ErrInvalidID struct {
id string
pattern string
}
func (e *ErrInvalidID) Error() string {
return fmt.Sprintf("service ID `%s` does not match the pattern \"%s\"", e.id, e.pattern)
}
type ErrInvalidTagName struct {
name string
pattern string
}
func (e *ErrInvalidTagName) Error() string {
return fmt.Sprintf("tag name `%s` does not match the pattern \"%s\"", e.name, e.pattern)
}