Skip to content

Commit

Permalink
Update elasticsearch.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Ice3man543 committed Sep 18, 2021
1 parent 54214eb commit 712e3ae
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion v2/pkg/reporting/exporters/es/elasticsearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ func (i *Exporter) Export(event *output.ResultEvent) error {
req.Body = ioutil.NopCloser(bytes.NewReader(b))

res, err := i.elasticsearch.Do(req)
b, _ = ioutil.ReadAll(res.Body)
if err != nil {
return err
}

b, err = ioutil.ReadAll(res.Body)
if err != nil {
return errors.New(err.Error() + "error thrown by elasticsearch " + string(b))
}
Expand Down

0 comments on commit 712e3ae

Please sign in to comment.