-
-
Notifications
You must be signed in to change notification settings - Fork 962
/
errors.go
29 lines (22 loc) · 1015 Bytes
/
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
package awsproviderpatch
import "fmt"
type MissingOverrideAttrError string
func (flagName MissingOverrideAttrError) Error() string {
return fmt.Sprintf("You must specify at least one provider attribute to override via the --%s option.", string(flagName))
}
type TypeInferenceError struct {
value string
underlyingErr error
}
func (err TypeInferenceError) Error() string {
val := err.value
return fmt.Sprintf(`Could not determine underlying type of JSON string %s. This usually happens when the JSON string is malformed, or if the value is not properly quoted (e.g., "%s"). Underlying error: %s`, val, val, err.underlyingErr)
}
type MalformedJSONValError struct {
value string
underlyingErr error
}
func (err MalformedJSONValError) Error() string {
val := err.value
return fmt.Sprintf(`Error unmarshaling JSON string %s. This usually happens when the JSON string is malformed, or if the value is not properly quoted (e.g., "%s"). Underlying error: %s`, val, val, err.underlyingErr)
}