Improve error description in influxdb_v2 output (#4952)
This commit is contained in:
parent
9035505e08
commit
ad5fcf8efb
|
@ -193,7 +193,7 @@ func (c *httpClient) Write(ctx context.Context, metrics []telegraf.Metric) error
|
||||||
err = json.NewDecoder(resp.Body).Decode(writeResp)
|
err = json.NewDecoder(resp.Body).Decode(writeResp)
|
||||||
desc := writeResp.Error()
|
desc := writeResp.Error()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
desc = err.Error()
|
desc = resp.Status
|
||||||
}
|
}
|
||||||
|
|
||||||
switch resp.StatusCode {
|
switch resp.StatusCode {
|
||||||
|
|
Loading…
Reference in New Issue