Skip to content

Commit

Permalink
relax elasticsearch consumer's definition of an error, make it accept…
Browse files Browse the repository at this point in the history
… all 200s as a valid response from the server
  • Loading branch information
northdpole committed Oct 2, 2024
1 parent dc70704 commit 2d96134
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/consumers/elasticsearch/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func main() {
log.Fatal("Could not parse raw issue", err)
}
res, err := es.Index(esIndex, bytes.NewBuffer(b))
if err != nil || res.StatusCode != 200 || res.IsError() {
if err != nil || res.StatusCode > 299 || res.IsError() {
log.Fatalf("could not push raw issue to index: %s, status code received: %d, elasticsearch result: %s, error:%s", esIndex, res.StatusCode, dumpStringResponse(res), err)
}
}
Expand All @@ -111,7 +111,7 @@ func main() {
log.Fatalf("Could not parse enriched issue error:%s", err)
}
res, err := es.Index(esIndex, bytes.NewBuffer(b))
if err != nil || res.StatusCode != 200 || res.IsError() {
if err != nil || res.StatusCode > 299 || res.IsError() {
log.Fatalf("could not push enriched issue to index: %s, status code received: %d, elasticsearch result: %s, error:%s", esIndex, res.StatusCode, dumpStringResponse(res), err)
}
}
Expand Down

0 comments on commit 2d96134

Please sign in to comment.