Skip to content
This repository was archived by the owner on May 24, 2024. It is now read-only.

Commit eeb8b29

Browse files
authored
Merge pull request #76 from LF-Engineering/fix-elastic-auth0-compitablity-issue
Log params on server not elastic error
2 parents b8ed531 + d6fb334 commit eeb8b29

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

elastic/client.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,11 @@ func NewClientProvider(params *Params) (*ClientProvider, error) {
2828
Username: params.Username,
2929
Password: params.Password,
3030
}
31-
3231
client, err := elasticsearch.NewClient(config)
3332
if err != nil {
3433
return nil, err
3534
}
36-
return &ClientProvider{client}, err
35+
return &ClientProvider{client, params}, err
3736
}
3837

3938
// CheckIfIndexExists checks if an es index exists and returns a bool depending on whether it exists or not.
@@ -478,6 +477,9 @@ func (p *ClientProvider) Search(index string, query map[string]interface{}) ([]b
478477
p.client.Search.WithBody(&buf),
479478
)
480479
if err != nil {
480+
if strings.Contains(err.Error(), "server is not Elasticsearch") {
481+
fmt.Println("esssssss", p.params)
482+
}
481483
return nil, err
482484
}
483485

elastic/dto.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
// ClientProvider ...
88
type ClientProvider struct {
99
client *elasticsearch.Client
10+
params *Params
1011
}
1112

1213
// Params ...

0 commit comments

Comments
 (0)