Optimize the error message

Signed-off-by: chengdehao <dehaocheng@yunify.com>
This commit is contained in:
chengdehao
2022-01-24 16:52:02 +08:00
parent 77d14fe4dc
commit 37369334f1
5 changed files with 44 additions and 10 deletions

View File

@@ -0,0 +1,19 @@
package versions
type Error struct {
Status int `json:"status"`
Details *ErrorDetails `json:"error,omitempty"`
}
type ErrorDetails struct {
Type string `json:"type"`
Reason string `json:"reason"`
ResourceType string `json:"resource.type,omitempty"`
ResourceId string `json:"resource.id,omitempty"`
Index string `json:"index,omitempty"`
Phase string `json:"phase,omitempty"`
Grouped bool `json:"grouped,omitempty"`
CausedBy map[string]interface{} `json:"caused_by,omitempty"`
RootCause []*ErrorDetails `json:"root_cause,omitempty"`
FailedShards []map[string]interface{} `json:"failed_shards,omitempty"`
}