-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patherrors.go
More file actions
41 lines (34 loc) · 1009 Bytes
/
errors.go
File metadata and controls
41 lines (34 loc) · 1009 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
40
41
package flagsmithapi
import (
"fmt"
)
type FeatureNotFoundError struct {
featureUUID string
}
type FeatureStateNotFoundError struct {
featureStateUUID string
}
type SegmentNotFoundError struct {
segmentUUID string
}
type FeatureMVOptionNotFoundError struct {
featureMVOptionUUID string
}
type UserNotFoundError struct {
email string
}
func (e FeatureNotFoundError) Error() string {
return fmt.Sprintf("flagsmithapi: feature '%s' not found", e.featureUUID)
}
func (e SegmentNotFoundError) Error() string {
return fmt.Sprintf("flagsmithapi: segment '%s' not found", e.segmentUUID)
}
func (e FeatureStateNotFoundError) Error() string {
return fmt.Sprintf("flagsmithapi: feature state '%s' not found", e.featureStateUUID)
}
func (e FeatureMVOptionNotFoundError) Error() string {
return fmt.Sprintf("flagsmithapi: feature mv option '%s' not found", e.featureMVOptionUUID)
}
func (e UserNotFoundError) Error() string {
return fmt.Sprintf("flagsmithapi: user with email '%s' not found", e.email)
}