summaryrefslogtreecommitdiffstats
path: root/vendor/gopkg.in/olivere/elastic.v5/errors.go
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2018-02-19 11:19:39 +0000
committerGeorge Goldberg <george@gberg.me>2018-02-19 11:19:39 +0000
commitf8289eb286d00c29859a8df495b957c7b46cb249 (patch)
tree1bc18d6a3a795482c7229786f7ab427fabbcd007 /vendor/gopkg.in/olivere/elastic.v5/errors.go
parent8891fa2a5e9e08eb9fa99ec163c47a6e9761a816 (diff)
parent30197584d5a215a3b25bffa79a034ed9e360cf52 (diff)
downloadchat-f8289eb286d00c29859a8df495b957c7b46cb249.tar.gz
chat-f8289eb286d00c29859a8df495b957c7b46cb249.tar.bz2
chat-f8289eb286d00c29859a8df495b957c7b46cb249.zip
Merge branch 'master' into advanced-permissions-phase-1
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).