#[non_exhaustive]pub enum RerankError {
Network(String),
Auth(String),
RateLimited(String),
BadRequest {
status: u16,
body: String,
},
Server {
status: u16,
body: String,
},
Decode(String),
Config(String),
Inference(String),
ScoreCountMismatch {
expected: usize,
got: usize,
},
}Expand description
Error surface for cross-encoder reranker adapters.
Marked #[non_exhaustive] so provider crates can grow their own
failure modes without a breaking change here.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Network(String)
TLS / TCP / DNS / timeout failure reaching the provider.
Auth(String)
Provider rejected credentials.
RateLimited(String)
Provider rate-limited the request.
BadRequest
4xx from the provider.
Server
5xx from the provider.
Decode(String)
Response decoder failed (malformed JSON, missing score field, …).
Config(String)
Adapter config invalid (bad URL, missing env var, etc.).
Inference(String)
Model / tokenizer / ONNX session runtime failure, distinct from
config-time validation. Mirrors crate::sparse::SparseError::Inference
so sibling provider traits surface runtime failures with a
consistent shape.
ScoreCountMismatch
Provider returned a different number of scores than candidates. Implementations MUST reject this up front; the retriever would otherwise zip mismatched pairs.
Trait Implementations§
Source§impl Debug for RerankError
impl Debug for RerankError
Source§impl Display for RerankError
impl Display for RerankError
Source§impl Error for RerankError
impl Error for RerankError
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()