pub enum Error {
Auth(String),
Validation {
code: String,
message: String,
},
RateLimited {
retry_after: Duration,
},
Server(String),
Network(Error),
Decode(Error),
}Expand description
Unified error surface for typed-client operations.
Variants§
Auth(String)
Authentication or authorization failure (HTTP 401/403, bad header bytes, etc.). Caller should re-credential, not retry the same payload.
Validation
Server rejected the request payload or current state (HTTP 4xx other
than 401/403/429). code is the TaskFast error envelope tag (e.g.
"validation_error"); message is the human-readable detail.
Fields
RateLimited
Server responded 429 Too Many Requests. retry_after reflects the
Retry-After header (or a 1-second default when absent/unparseable).
Server(String)
Server-side failure (HTTP 5xx) or pre-flight client-side error that callers should treat as transient + retry-eligible.
Network(Error)
Underlying transport (DNS, connect, TLS, body stream) failed.
Decode(Error)
Response body could not be deserialised into the expected schema.
Implementations§
Source§impl Error
impl Error
Sourcepub fn kind(&self) -> &'static str
pub fn kind(&self) -> &'static str
Short, stable variant tag for logging without leaking the inner
message. A compromised server (or an endpoint that echoes request
bodies into its error strings) could land an X-API-Key value
inside an Auth/Server payload — logging the full Display
would then page the secret into any log sink. Callers that need
logging should prefer Self::kind over ?err.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.