pub enum CheckErr {
Denied(String),
Offline(String),
}Expand description
Why a license check couldn’t reach a positive verdict. The distinction decides whether we honor the offline grace window or fail closed.
A subtle failure mode to avoid: treating all errors as “offline” — a wrong-account or
revoked license then silently rode the grace window. Mapping authoritative 4xx
answers to CheckErr::Denied (no grace) is what fixes that.
Variants§
Denied(String)
Authoritative rejection (4xx: wrong account, unauthorized, bad request) — the server answered “no”. Lock; do not ride offline grace.
Offline(String)
Transient connectivity issue (network error, timeout, 429/5xx, or an ambiguous non-JSON body — e.g. a captive portal). Honor the offline grace window.
Trait Implementations§
Source§impl Error for CheckErr
impl Error for CheckErr
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 Forget for CheckErr
impl Freeze for CheckErr
impl RefUnwindSafe for CheckErr
impl Send for CheckErr
impl Sync for CheckErr
impl Unpin for CheckErr
impl UnsafeUnpin for CheckErr
impl UnwindSafe for CheckErr
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