summaryrefslogtreecommitdiffstats
path: root/vendor/gopkg.in/olivere/elastic.v5/errors.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2018-02-16 06:47:51 -0800
committerJoram Wilander <jwawilander@gmail.com>2018-02-16 09:47:51 -0500
commit6d8f122a5160f6d9e4c51579f2429dfaa62c7271 (patch)
tree6e0242cd6709260abd74060a7ec7dc1381efa36e /vendor/gopkg.in/olivere/elastic.v5/errors.go
parentb112747de76f9c11c4d8083207049fac6e435019 (diff)
downloadchat-6d8f122a5160f6d9e4c51579f2429dfaa62c7271.tar.gz
chat-6d8f122a5160f6d9e4c51579f2429dfaa62c7271.tar.bz2
chat-6d8f122a5160f6d9e4c51579f2429dfaa62c7271.zip
Upgrading server dependancies (#8308)
Diffstat (limited to 'vendor/gopkg.in/olivere/elastic.v5/errors.go')
-rw-r--r--vendor/gopkg.in/olivere/elastic.v5/errors.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/vendor/gopkg.in/olivere/elastic.v5/errors.go b/vendor/gopkg.in/olivere/elastic.v5/errors.go
index 00a936621..e40cda845 100644
--- a/vendor/gopkg.in/olivere/elastic.v5/errors.go
+++ b/vendor/gopkg.in/olivere/elastic.v5/errors.go
@@ -9,6 +9,8 @@ import (
"fmt"
"io/ioutil"
"net/http"
+
+ "github.com/pkg/errors"
)
// checkResponse will return an error if the request/response indicates
@@ -89,6 +91,12 @@ func (e *Error) Error() string {
}
}
+// IsConnErr returns true if the error indicates that Elastic could not
+// find an Elasticsearch host to connect to.
+func IsConnErr(err error) bool {
+ return err == ErrNoClient || errors.Cause(err) == ErrNoClient
+}
+
// IsNotFound returns true if the given error indicates that Elasticsearch
// returned HTTP status 404. The err parameter can be of type *elastic.Error,
// elastic.Error, *http.Response or int (indicating the HTTP status code).