Skip to content

Commit

Permalink
create index: work around non-existing index
Browse files Browse the repository at this point in the history
  • Loading branch information
miku committed Oct 18, 2017
1 parent e244be6 commit eeef00b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions indexing.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,11 @@ func CreateIndex(options Options) error {
Status int `json:"status"`
}
rdr := io.TeeReader(resp.Body, os.Stderr)
if err := json.NewDecoder(rdr).Decode(&errResponse); err != nil {
return err
}
if strings.Contains(errResponse.Error, "IndexAlreadyExistsException") {
return nil
// Might return a 400 on "No handler found for uri" ...
if err := json.NewDecoder(rdr).Decode(&errResponse); err == nil {
if strings.Contains(errResponse.Error, "IndexAlreadyExistsException") {
return nil
}
}
}

Expand Down

0 comments on commit eeef00b

Please # to comment.