pub enum SearchError {
IndexNotFound(String),
AccessDenied(String),
BadQuery(String),
Backend(String),
}Expand description
Typed error returned by every SearchClientPlugin method.
Flat enum, not Result<_, String>, because classification matters:
the capability dispatcher distinguishes “you asked for something that
does not exist” from “you asked for something you cannot see” from
“your query itself was malformed” from “the backend blew up”. Each
variant carries a message for operator-facing logs; callers should
match on the variant, not inspect the string.
Variants§
IndexNotFound(String)
Index does not exist in the backend. Not the same as “empty
index”; that returns Ok(SearchResults { hits: vec![], .. }).
AccessDenied(String)
Authentication or authorisation failed. Wrong API key, wrong
role, wrong network. Distinct from Backend so the dispatcher
can escalate credentials issues without paging on transport
flakes.
BadQuery(String)
The query itself was malformed — syntax error, unsupported filter shape, out-of-range offset. Caller error, not backend fault. Recoverable by fixing the input.
Backend(String)
Everything else: network failure, backend 5xx, driver panic, timeout. Not classified further because the caller cannot recover from any of them except by retrying or alerting.
Trait Implementations§
Source§impl Clone for SearchError
impl Clone for SearchError
Source§fn clone(&self) -> SearchError
fn clone(&self) -> SearchError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SearchError
impl Debug for SearchError
Source§impl<'de> Deserialize<'de> for SearchError
impl<'de> Deserialize<'de> for SearchError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for SearchError
impl Display for SearchError
Source§impl Error for SearchError
impl Error for SearchError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()