pub enum DecideError {
NotConfigured(String),
Provider {
provider: String,
status: Option<u16>,
message: String,
retryable: bool,
},
Malformed(String),
Deadline(String),
ChainExhausted(Vec<(String, DecideError)>),
InvalidQuestion(String),
RateLimited {
provider: String,
retry_after_secs: Option<u64>,
},
EgressRefused(String),
}Expand description
Every decision-backend failure. Display leads with a stable DEC-Ennn
code and DecideError::code returns it; codes are append-only
(ERROR_CODES.md).
Variants§
NotConfigured(String)
DEC-E001 — no backend configured, or the spec did not parse
(unknown provider, missing key — the message names the env var).
Provider
DEC-E002 — provider transport or HTTP error. status is the HTTP
status when there was one; retryable is true for 5xx and transport
faults, false for 4xx.
Malformed(String)
DEC-E003 — malformed answer: a missing question id, probabilities
absent or not summing to 1, a type mismatch, an unknown type.
Deadline(String)
DEC-E004 — the deadline elapsed before an answer arrived.
ChainExhausted(Vec<(String, DecideError)>)
DEC-E005 — every chain entry failed; carries (describe(), error)
per entry, in chain order.
InvalidQuestion(String)
DEC-E006 — an invalid question (option/level count out of range,
empty instructions, no questions at all). Never retried.
RateLimited
DEC-E007 — rate limited (HTTP 429). retry_after_secs is the
Retry-After header when the provider sent one in seconds form. The
adapter never sleeps on it.
EgressRefused(String)
DEC-E008 — egress pseudonymization of the request’s state failed
(areev_llm::PseudonymizingDecider), so the request was NOT sent. It
stops a chain (DecideError::stops_chain): a later entry may be
unwrapped, and moving on would send the raw state the policy just
refused to let out.
Implementations§
Source§impl DecideError
impl DecideError
Sourcepub fn retry_after_secs(&self) -> Option<u64>
pub fn retry_after_secs(&self) -> Option<u64>
Retry-After seconds carried by a DEC-E007.
Sourcepub fn stops_chain(&self) -> bool
pub fn stops_chain(&self) -> bool
Whether a provider chain (areev_llm::decide::Chain) must stop here instead of trying the next entry:
our own invalid question (DEC-E006), or a provider that refused the
request itself as invalid (HTTP 400/422) — resending an invalid
request elsewhere is not a fallback — or an egress pseudonymization
failure (DEC-E008), where moving on could send raw state to an
entry the wrap does not cover.
Trait Implementations§
Source§impl Clone for DecideError
impl Clone for DecideError
Source§impl Debug for DecideError
impl Debug for DecideError
Source§impl Display for DecideError
impl Display for DecideError
Source§impl Error for DecideError
impl Error for DecideError
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()