diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 588dcdc5d..f8b04ea52 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -77,6 +77,7 @@ Naoya Tsutsumi [@tutuming](https://github.com/tutuming) Nicholas Wolff [@nwolff](https://github.com/nwolff) Nick K [@utrack](https://github.com/utrack) Nick Whyte [@nickw444](https://github.com/nickw444) +Nicolae Vartolomei [@nvartolomei](https://github.com/nvartolomei) Orne Brocaar [@brocaar](https://github.com/brocaar) Pete C [@peteclark-ft](https://github.com/peteclark-ft) Radoslaw Wesolowski [r--w](https://github.com/r--w) diff --git a/client.go b/client.go index db71d771e..ddf123cfe 100644 --- a/client.go +++ b/client.go @@ -22,7 +22,7 @@ import ( const ( // Version is the current version of Elastic. - Version = "5.0.41" + Version = "5.0.42" // DefaultURL is the default endpoint of Elasticsearch on the local machine. // It is used e.g. when initializing a new Client without a specific URL. diff --git a/client_test.go b/client_test.go index a6fe011e9..1441f1791 100644 --- a/client_test.go +++ b/client_test.go @@ -973,6 +973,22 @@ func TestPerformRequestWithLoggerAndTracer(t *testing.T) { t.Errorf("expected tracer output; got: %q", tgot) } } +func TestPerformRequestWithTracerOnError(t *testing.T) { + var tw bytes.Buffer + tout := log.New(&tw, "TRACER ", log.LstdFlags) + + client, err := NewClient(SetTraceLog(tout), SetSniff(false)) + if err != nil { + t.Fatal(err) + } + + client.PerformRequest(context.TODO(), "GET", "/no-such-index", nil, nil) + + tgot := tw.String() + if tgot == "" { + t.Errorf("expected tracer output; got: %q", tgot) + } +} type customLogger struct { out bytes.Buffer