pub enum MisarDevError {
Validation(ApiError),
Authentication(ApiError),
PermissionDenied(ApiError),
NotFound(ApiError),
Conflict(ApiError),
RateLimit(Box<RateLimitError>),
Server(ApiError),
PlanLimit(Box<PlanLimitError>),
Api(ApiError),
Network {
message: String,
source: Option<Error>,
},
MissingApiKey,
Config(String),
}Expand description
Every error the SDK returns.
Variants§
Validation(ApiError)
400 / 422 — the request was malformed or failed validation.
Authentication(ApiError)
401 — the key is missing, revoked, expired, or not a MisarDev key.
PermissionDenied(ApiError)
403 — authenticated, but not allowed to touch this resource.
NotFound(ApiError)
404 — no such resource, or not one this key can see.
Conflict(ApiError)
409 — conflicts with current state (e.g. a build already running).
RateLimit(Box<RateLimitError>)
429 that is an ordinary throttle, after the client already retried it.
Server(ApiError)
5xx — the API failed. Retried automatically for idempotent requests.
PlanLimit(Box<PlanLimitError>)
The plan behind the key does not cover this call. Never retried.
Api(ApiError)
Any other non-2xx status.
Network
The request never got an HTTP answer (DNS, TLS, reset, timeout). Status 0.
MissingApiKey
No API key was passed and MISARDEV_API_KEY is unset.
Config(String)
The client could not be configured (e.g. the HTTP client failed to build).
Implementations§
Source§impl MisarDevError
impl MisarDevError
Sourcepub fn request_id(&self) -> Option<&str>
pub fn request_id(&self) -> Option<&str>
The x-request-id header.
Sourcepub fn rate_limit(&self) -> Option<&RateLimitError>
pub fn rate_limit(&self) -> Option<&RateLimitError>
The throttle details, when this is an ordinary rate limit.
Sourcepub fn plan_limit(&self) -> Option<&PlanLimitError>
pub fn plan_limit(&self) -> Option<&PlanLimitError>
The plan-limit details, when this is a plan refusal.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Worth retrying as-is: a throttle or a transient server condition.
Trait Implementations§
Source§impl Debug for MisarDevError
impl Debug for MisarDevError
Source§impl Display for MisarDevError
impl Display for MisarDevError
Source§impl Error for MisarDevError
impl Error for MisarDevError
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()