diff options
author | Mat Schaffer <mat@schaffer.me> | 2018-08-20 11:45:48 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-20 11:45:48 +0900 |
commit | 7f6f2d1fae833992b11500248d537e0ba3fa48ff (patch) | |
tree | 59ede0e309433fc5796c568e5e4e60a8c1a762c9 /vendor/github.com/DreamItGetIT/statuscake/errors.go | |
parent | a6ddc0c931c22051c2f072877a1e0b18a939ef2e (diff) | |
parent | 65c668b059fb4da3f52a461be2e5c77ac0bcf2a7 (diff) | |
download | terraform-provider-statuscake-7f6f2d1fae833992b11500248d537e0ba3fa48ff.tar.gz terraform-provider-statuscake-7f6f2d1fae833992b11500248d537e0ba3fa48ff.tar.zst terraform-provider-statuscake-7f6f2d1fae833992b11500248d537e0ba3fa48ff.zip |
Merge pull request #18 from matschaffer/contact-groups-support
Add test contact group support
Diffstat (limited to 'vendor/github.com/DreamItGetIT/statuscake/errors.go')
-rw-r--r-- | vendor/github.com/DreamItGetIT/statuscake/errors.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/vendor/github.com/DreamItGetIT/statuscake/errors.go b/vendor/github.com/DreamItGetIT/statuscake/errors.go index 4c51991..c336647 100644 --- a/vendor/github.com/DreamItGetIT/statuscake/errors.go +++ b/vendor/github.com/DreamItGetIT/statuscake/errors.go | |||
@@ -34,12 +34,15 @@ func (e ValidationError) Error() string { | |||
34 | } | 34 | } |
35 | 35 | ||
36 | type updateError struct { | 36 | type updateError struct { |
37 | Issues interface{} | 37 | Issues interface{} |
38 | Message string | ||
38 | } | 39 | } |
39 | 40 | ||
40 | func (e *updateError) Error() string { | 41 | func (e *updateError) Error() string { |
41 | var messages []string | 42 | var messages []string |
42 | 43 | ||
44 | messages = append(messages, e.Message) | ||
45 | |||
43 | if issues, ok := e.Issues.(map[string]interface{}); ok { | 46 | if issues, ok := e.Issues.(map[string]interface{}); ok { |
44 | for k, v := range issues { | 47 | for k, v := range issues { |
45 | m := fmt.Sprintf("%s %s", k, v) | 48 | m := fmt.Sprintf("%s %s", k, v) |
@@ -50,6 +53,9 @@ func (e *updateError) Error() string { | |||
50 | m := fmt.Sprint(v) | 53 | m := fmt.Sprint(v) |
51 | messages = append(messages, m) | 54 | messages = append(messages, m) |
52 | } | 55 | } |
56 | } else if issue, ok := e.Issues.(interface{}); ok { | ||
57 | m := fmt.Sprint(issue) | ||
58 | messages = append(messages, m) | ||
53 | } | 59 | } |
54 | 60 | ||
55 | return strings.Join(messages, ", ") | 61 | return strings.Join(messages, ", ") |