#[non_exhaustive]pub enum SolariError {
Auth {
status: u16,
message: String,
code: Option<String>,
},
Plan {
status: u16,
message: String,
code: Option<String>,
},
ConcurrencyLimit {
status: u16,
message: String,
code: Option<String>,
},
NoCapacity {
status: u16,
message: String,
code: Option<String>,
},
Gateway {
status: u16,
message: String,
code: Option<String>,
},
Action {
method: String,
message: String,
code: Option<String>,
},
Timeout {
method: String,
timeout_ms: u64,
},
Connection {
message: String,
},
Git {
message: String,
},
Other(String),
Validation {
message: String,
},
}Expand description
Every error raised by the SDK. Corresponds to the SolariError hierarchy in
the TypeScript reference (AuthError / PlanError / ConcurrencyLimitError /
NoCapacityError / GatewayError / ActionError / TimeoutError / ConnectionError).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Auth
HTTP 401 — the API key was missing, malformed, or rejected.
Plan
The plan does not allow this: HTTP 402 (FeatureRequiresPlan, InsufficientCredit) or 403 NotEntitled (the plan
does not include sandboxes/desktops). status is the status the gateway really sent.
ConcurrencyLimit
HTTP 429 ConcurrencyLimitExceeded (or a 429 with no code) — the org is at its session cap. NOT retryable. Other 429s
(TooManyExecutions, a per-sandbox limit, ObjectLimit, the template caps) are Gateway errors with the gateway’s code.
NoCapacity
HTTP 503 NoCapacity / StartTimeout (or a 503 with no code) — no host available (retryable). Other 503s
(SandboxUnavailable, StoreUnavailable, AdmissionUnavailable, DependencyUnavailable) are Gateway errors: the
sandbox, store or admission service is unavailable, which is not a capacity problem.
Gateway
Any other non-2xx gateway response (incl. 404/405/409/501).
Action
A control-WS RPC replied {ok:false}.
Timeout
A call (or connect) did not complete within its timeout.
Connection
The control WebSocket is not open (never connected, or dropped).
Git
A git subcommand exited non-zero (message includes sub/exit/detail).
Other(String)
Anything else (bad response body, internal invariant).
Validation
A caller passed an invalid argument (e.g. a blank session id). Distinct
from Other: this is the caller’s input to fix, not an unexpected
server response.
Implementations§
Trait Implementations§
Source§impl Debug for SolariError
impl Debug for SolariError
Source§impl Display for SolariError
impl Display for SolariError
Source§impl Error for SolariError
impl Error for SolariError
1.30.0 · 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()