-
Notifications
You must be signed in to change notification settings - Fork 50
/
registry_errors.go
83 lines (72 loc) · 2.7 KB
/
registry_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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package errors
const (
ErrRegistryIllegalIDFormatMsg = "illegal format of provided ID value"
ErrRegistryUnauthorizedMsg = "unauthorized"
ErrRegistryInternalErrorsMsg = "unexpected internal errors"
ErrRegistryNoPermissionMsg = "user does not have permission to the registry"
ErrRegistryIDNotExistsMsg = "registry ID does not exist"
ErrRegistryNameAlreadyExistsMsg = "registry name already exists"
ErrRegistryMismatchMsg = "id/name pair not found on server side"
ErrRegistryNotFoundMsg = "registry not found on server side"
ErrRegistryNotProvidedMsg = "no registry provided"
)
type (
// ErrRegistryIllegalIDFormat describes an illegal request format.
ErrRegistryIllegalIDFormat struct{}
// ErrRegistryUnauthorized describes an unauthorized request.
ErrRegistryUnauthorized struct{}
// ErrRegistryInternalErrors describes server-side internal errors.
ErrRegistryInternalErrors struct{}
// ErrRegistryNoPermission describes a request error without permission.
ErrRegistryNoPermission struct{}
// ErrRegistryIDNotExists describes an error
// when no proper registry ID is found.
ErrRegistryIDNotExists struct{}
// ErrRegistryNameAlreadyExists describes a duplicate registry name error.
ErrRegistryNameAlreadyExists struct{}
// ErrRegistryMismatch describes a failed lookup
// of a registry with name/id pair.
ErrRegistryMismatch struct{}
// ErrRegistryNotFound describes an error
// when a specific registry is not found.
ErrRegistryNotFound struct{}
// ErrRegistryNotProvided describes an error
// when no registry was provided.
ErrRegistryNotProvided struct{}
)
// Error returns the error message.
func (e *ErrRegistryIllegalIDFormat) Error() string {
return ErrRegistryIllegalIDFormatMsg
}
// Error returns the error message.
func (e *ErrRegistryUnauthorized) Error() string {
return ErrRegistryUnauthorizedMsg
}
// Error returns the error message.
func (e *ErrRegistryInternalErrors) Error() string {
return ErrRegistryInternalErrorsMsg
}
// Error returns the error message.
func (e *ErrRegistryNoPermission) Error() string {
return ErrRegistryNoPermissionMsg
}
// Error returns the error message.
func (e *ErrRegistryIDNotExists) Error() string {
return ErrRegistryIDNotExistsMsg
}
// Error returns the error message.
func (e *ErrRegistryNameAlreadyExists) Error() string {
return ErrRegistryNameAlreadyExistsMsg
}
// Error returns the error message.
func (e *ErrRegistryMismatch) Error() string {
return ErrRegistryMismatchMsg
}
// Error returns the error message.
func (e *ErrRegistryNotFound) Error() string {
return ErrRegistryNotFoundMsg
}
// Error returns the error message.
func (e *ErrRegistryNotProvided) Error() string {
return ErrRegistryNotProvidedMsg
}