diff --git a/pkg/simple/client/elasticsearch/esclient.go b/pkg/simple/client/elasticsearch/esclient.go index 7ed03aaee..cb5fd1711 100644 --- a/pkg/simple/client/elasticsearch/esclient.go +++ b/pkg/simple/client/elasticsearch/esclient.go @@ -117,7 +117,7 @@ func detectVersionMajor(host string) (string, error) { if res.IsError() { // Print the response status and error information. e, _ := b["error"].(map[string]interface{}) - return "", fmt.Errorf("[%s] %s: %s", res.Status(), e["type"], e["reason"]) + return "", fmt.Errorf("[%s] type: %v, reason: %v", res.Status(), e["type"], e["reason"]) } // get the major version diff --git a/pkg/simple/client/elasticsearch/versions/v5/elasticsearch.go b/pkg/simple/client/elasticsearch/versions/v5/elasticsearch.go index b5865c95b..48d0f5fe0 100644 --- a/pkg/simple/client/elasticsearch/versions/v5/elasticsearch.go +++ b/pkg/simple/client/elasticsearch/versions/v5/elasticsearch.go @@ -83,6 +83,6 @@ func parseError(response *esapi.Response) error { } else { // Print the response status and error information. e, _ := e["error"].(map[string]interface{}) - return fmt.Errorf("%s: %s", e["type"], e["reason"]) + return fmt.Errorf("type: %v, reason: %v", e["type"], e["reason"]) } } diff --git a/pkg/simple/client/elasticsearch/versions/v6/elasticsearch.go b/pkg/simple/client/elasticsearch/versions/v6/elasticsearch.go index 33e55261c..c6ec6590c 100644 --- a/pkg/simple/client/elasticsearch/versions/v6/elasticsearch.go +++ b/pkg/simple/client/elasticsearch/versions/v6/elasticsearch.go @@ -83,6 +83,6 @@ func parseError(response *esapi.Response) error { } else { // Print the response status and error information. e, _ := e["error"].(map[string]interface{}) - return fmt.Errorf("%s: %s", e["type"], e["reason"]) + return fmt.Errorf("type: %v, reason: %v", e["type"], e["reason"]) } } diff --git a/pkg/simple/client/elasticsearch/versions/v7/elasticsearch.go b/pkg/simple/client/elasticsearch/versions/v7/elasticsearch.go index ff0d69916..030cf126b 100644 --- a/pkg/simple/client/elasticsearch/versions/v7/elasticsearch.go +++ b/pkg/simple/client/elasticsearch/versions/v7/elasticsearch.go @@ -86,6 +86,6 @@ func parseError(response *esapi.Response) error { } else { // Print the response status and error information. e, _ := e["error"].(map[string]interface{}) - return fmt.Errorf("%s: %s", e["type"], e["reason"]) + return fmt.Errorf("type: %v, reason: %v", e["type"], e["reason"]) } }