pub enum JudgmentError {
Invalid(String),
Unauthorized,
Exhausted,
RateLimited {
retry_after: Option<Duration>,
},
Unavailable {
status: u16,
},
Transport(Box<dyn Error + Send + Sync + 'static>),
Malformed(String),
}Expand description
The failure classes a judgment backend reports.
The classes are stable across backends so a decision site can fail closed the same way whichever backend answers. No variant carries a request body, a response body, or a credential.
Variants§
Invalid(String)
The backend rejected the request shape. Retrying the same request cannot succeed.
The backend refused the credential.
Exhausted
The backend refused for lack of credit or quota.
RateLimited
The backend asked the caller to back off.
The backend is temporarily unavailable.
Transport(Box<dyn Error + Send + Sync + 'static>)
The request did not complete on the transport.
Malformed(String)
The response did not decode into the answer types.
Trait Implementations§
Source§impl Debug for JudgmentError
impl Debug for JudgmentError
Source§impl Display for JudgmentError
impl Display for JudgmentError
Source§impl Error for JudgmentError
impl Error for JudgmentError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for JudgmentError
impl !UnwindSafe for JudgmentError
impl Freeze for JudgmentError
impl Send for JudgmentError
impl Sync for JudgmentError
impl Unpin for JudgmentError
impl UnsafeUnpin for JudgmentError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more