/
errors.go
91 lines (76 loc) · 1.99 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
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
84
85
86
87
88
89
90
91
// Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
"fmt"
smithy "github.com/aws/smithy-go"
)
// This error is thrown when a request is invalid.
type ComplexError struct {
Message *string
ErrorCodeOverride *string
Header *string
TopLevel *string
Nested *ComplexNestedErrorData
noSmithyDocumentSerde
}
func (e *ComplexError) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ComplexError) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ComplexError) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "ComplexError"
}
return *e.ErrorCodeOverride
}
func (e *ComplexError) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// This error has test cases that test some of the dark corners of Amazon service
// framework history. It should only be implemented by clients.
type FooError struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *FooError) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *FooError) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *FooError) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "FooError"
}
return *e.ErrorCodeOverride
}
func (e *FooError) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// This error is thrown when an invalid greeting value is provided.
type InvalidGreeting struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InvalidGreeting) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidGreeting) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidGreeting) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "InvalidGreeting"
}
return *e.ErrorCodeOverride
}
func (e *InvalidGreeting) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }