1package client
2
3import "errors"
4import "fmt"
5
6// ErrorProtocol
7var ErrorProtocol = errors.New("queryport.client.protocol")
8
9// ErrorNoHost
10var ErrorNoHost = errors.New("queryport.client.noHost")
11
12// ErrorIndexNotFound
13var ErrorIndexNotFound = errors.New("queryport.indexNotFound")
14
15// ErrorInstanceNotFound
16var ErrorInstanceNotFound = errors.New("queryport.instanceNotFound")
17
18// ErrorClientUninitialized
19var ErrorClientUninitialized = errors.New("queryport.clientUninitialized")
20
21// ErrorNotImplemented
22var ErrorNotImplemented = errors.New("queryport.notImplemented")
23
24// ErrorInvalidConsistency
25var ErrorInvalidConsistency = errors.New("queryport.invalidConsistency")
26
27// ErrorExpectedTimestamp
28var ErrorExpectedTimestamp = errors.New("queryport.expectedTimestamp")
29
30// These error strings need to be in sync with common.ErrIndexNotFound
31// and common.ErrIndexNotReady.
32var ErrIndexNotFound = fmt.Errorf("Index not found")
33var ErrIndexNotReady = fmt.Errorf("Index not ready for serving queries")
34
35var errorDescriptions = map[string]string{
36	ErrorProtocol.Error():            "fatal protocol error with server",
37	ErrorNoHost.Error():              "All indexer replica is down or unavailable or unable to process request",
38	ErrorIndexNotFound.Error():       "index deleted or node hosting the index is down",
39	ErrorInstanceNotFound.Error():    "no instance available for the index",
40	ErrorClientUninitialized.Error(): "gsi client is not initialized",
41	ErrorNotImplemented.Error():      "client API not implemented",
42	ErrorInvalidConsistency.Error():  "supplied consistency is invalid",
43	ErrorExpectedTimestamp.Error():   "consistency timestamp is expected",
44	ErrIndexNotFound.Error():         "index is deleted or node hosting index is down",
45	ErrIndexNotReady.Error():         ErrIndexNotReady.Error(),
46}
47