Skip to content

Commit

Permalink
Improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKsyunz committed Jun 14, 2023
1 parent 37269f9 commit 9047dd6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion exporter/opensearchexporter/opensearch_bulk.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"bytes"
"context"
"crypto/tls"
"encoding/json"
"fmt"
"io"
"net/http"
Expand Down Expand Up @@ -205,7 +206,8 @@ func pushDocuments(ctx context.Context, logger *zap.Logger, index string, docume
zap.NamedError("reason", err))

default:
logger.Error(fmt.Sprintf("Drop dcos: failed to index: %#v", resp.Error),
erroJson, _ := json.Marshal(resp.Error)
logger.Error(fmt.Sprintf("Drop docs: failed to index: %s", erroJson),
zap.Int("attempt", attempts),
zap.Int("status", resp.Status))
}
Expand Down

0 comments on commit 9047dd6

Please sign in to comment.