Skip to content

Commit 9f50fd4

Browse files
committed
remove function
1 parent 51669de commit 9f50fd4

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

client/elasticClientCommon.go

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"strings"
1212

1313
"github.com/elastic/go-elasticsearch/v7/esapi"
14-
"github.com/multiversx/mx-chain-es-indexer-go/data"
1514
"github.com/multiversx/mx-chain-es-indexer-go/process/dataindexer"
1615
)
1716

@@ -194,28 +193,6 @@ func isErrAliasAlreadyExists(response map[string]interface{}) bool {
194193
return existsString == aliasExistsMessage
195194
}
196195

197-
func kibanaResponseErrorHandler(res *esapi.Response) error {
198-
errorRes := &data.Response{}
199-
decodeErr := loadResponseBody(res.Body, errorRes)
200-
if decodeErr != nil {
201-
return decodeErr
202-
}
203-
204-
errStr := fmt.Sprintf("%v", errorRes.Error)
205-
if errorRes.Status == http.StatusConflict && strings.Contains(errStr, errPolicyAlreadyExists) {
206-
return nil
207-
}
208-
209-
if errorRes.Error == nil && errorRes.Status < http.StatusBadRequest {
210-
return nil
211-
}
212-
213-
log.Warn("elasticClient.parseResponse",
214-
"error returned by elastic API", errorRes.Error,
215-
"code", res.StatusCode)
216-
return dataindexer.ErrBackOff
217-
}
218-
219196
func newRequest(method, path string, body *bytes.Buffer) *http.Request {
220197
r := http.Request{
221198
Method: method,

0 commit comments

Comments
 (0)