#[non_exhaustive]pub enum Error {
Config(String),
Transport(Error),
Http {
status: u16,
body: String,
},
Api {
operation: &'static str,
errors: Vec<GraphQlError>,
},
RateLimited {
retry_after: Option<Duration>,
info: Option<RateLimitInfo>,
},
Decode {
operation: &'static str,
source: Error,
},
MissingData {
operation: &'static str,
},
MutationFailed {
operation: &'static str,
},
}Expand description
Everything that can go wrong talking to the Linear API.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Config(String)
Client construction or configuration failure (missing API key, invalid endpoint URL, unset environment variable, …).
Transport(Error)
Network-level failure (connect, TLS, timeout). Mutations are NOT
retried on post-send transport errors by default: Linear has no
idempotency keys, so a timed-out issueCreate may have landed.
Http
Non-2xx HTTP response without a usable GraphQL error body.
Fields
Api
The server executed the request and returned GraphQL errors.
Fail-closed: raised even when partial data accompanied the errors
(LinearClient::execute_raw is
the lenient escape hatch).
Fields
errors: Vec<GraphQlError>The GraphQL errors as returned on the wire.
RateLimited
Rate limited and the required wait exceeded
RetryConfig::max_rate_limit_wait, or retries
were exhausted.
Fields
info: Option<RateLimitInfo>Rate-limit budget snapshot from the rejecting response’s headers.
Decode
The response data did not match this crate’s models — the runtime
schema-drift tripwire.
Fields
MissingData
The server returned neither data nor errors.
MutationFailed
A mutation payload reported success: false without GraphQL errors.
Implementations§
Source§impl Error
impl Error
Sourcepub fn is_rate_limited(&self) -> bool
pub fn is_rate_limited(&self) -> bool
true for Error::RateLimited, or an Error::Api carrying a
RATELIMITED-typed GraphQL error.
Sourcepub fn is_authentication(&self) -> bool
pub fn is_authentication(&self) -> bool
true when any attached GraphQL error is an authentication failure.
Sourcepub fn error_types(&self) -> Vec<LinearErrorType>
pub fn error_types(&self) -> Vec<LinearErrorType>
Typed Linear error classifications attached to this error (empty for
non-Error::Api variants and for errors without extensions).
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()