You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Oliver Eilhard edited this page May 6, 2017
·
7 revisions
Errors are returned with the standard Go mechanism. However, if you need to get the details of the error as reported by Elasticsearch, you can do so by "casting" to *elastic.Error. Here's an example:
_, err:=client.IndexExists("twitter").Do()
iferr!=nil {
// Get *elastic.Error which contains additional informatione, ok:=err.(*elastic.Error)
if!ok {
// This shouldn't happen...
}
log.Printf("Elastic failed with status %d and error %s.", e.Status, e.Details)
...
}