We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1b70a4b commit 706e3a2Copy full SHA for 706e3a2
api/api.go
@@ -41,6 +41,9 @@ type ScalewayAPIError struct {
41
// Type is a string code that defines the kind of error
42
Type string `json:"type,omitempty"`
43
44
+ // Fields contains detail about validation error
45
+ Fields map[string][]string `json:"fields,omitempty"`
46
+
47
// StatusCode is the HTTP status code received
48
StatusCode int `json:"-"`
49
@@ -69,6 +72,11 @@ func (e ScalewayAPIError) Debug() {
69
72
"Type": e.Type,
70
73
"Message": e.Message,
71
74
}).Debug(e.APIMessage)
75
76
+ // error.Fields handling
77
+ for k, v := range e.Fields {
78
+ log.Debugf(" %-30s %s", fmt.Sprintf("%s: ", k), v)
79
+ }
80
}
81
82
// ScalewayIPAddress represents a Scaleway IP address
0 commit comments