1package gocb
2
3// SearchError is the error type of all search query errors.
4// UNCOMMITTED: This API may change in the future.
5type SearchError struct {
6	InnerError    error         `json:"-"`
7	Query         interface{}   `json:"query,omitempty"`
8	Endpoint      string        `json:"endpoint,omitempty"`
9	RetryReasons  []RetryReason `json:"retry_reasons,omitempty"`
10	RetryAttempts uint32        `json:"retry_attempts,omitempty"`
11	ErrorText     string        `json:"error_text"`
12	IndexName     string        `json:"index_name,omitempty"`
13}
14
15// Error returns the string representation of this error.
16func (e SearchError) Error() string {
17	return e.InnerError.Error() + " | " + serializeWrappedError(e)
18}
19
20// Unwrap returns the underlying cause for this error.
21func (e SearchError) Unwrap() error {
22	return e.InnerError
23}
24