pub enum CloudError {
Show 28 variants
Offline(String),
NotConnected,
Unauthorized,
PlanRequired(Box<PlanNeed>),
InstanceLimit(Box<InstanceCap>),
QuotaExceeded(Box<Quota>),
StorageFull(Box<StorageFull>),
UploadRateLimited {
retry_after: Option<u64>,
per_hour: Option<u64>,
},
PolicyDenied(PolicyDenial),
LeaseLapsed,
Revoked(Revocation),
Forbidden,
Vetoed,
UploadDisabled(CloudUploadKind),
FeatureDisabled {
feature: Option<String>,
},
NotFound,
Conflict {
expected: Option<u64>,
actual: Option<u64>,
},
ScreeningBlocked,
UpgradeRequired {
min: Option<String>,
},
RateLimited {
retry_after: Option<u64>,
},
DeviceFlow(String),
TrialUnsupported {
origin: String,
},
Protocol(String),
Config(String),
Local(String),
Refused(String),
Task {
refusal: TaskRefusal,
number: Option<u64>,
detail: Option<String>,
},
Server {
status: u16,
code: String,
},
}Variants§
Offline(String)
Cloud could not be reached (DNS, connect, TLS, timeout, reset).
NotConnected
The instance is not enrolled on this machine.
The service refused the instance’s credentials.
PlanRequired(Box<PlanNeed>)
402 plan_required: the plan lacks a feature (C0 2.x names it), or,
from a 1.x Cloud that names none, Cloud itself (an engine seat).
InstanceLimit(Box<InstanceCap>)
Every instance seat of the organization is taken (409 instance_limit): registered instances, or those connected at once.
QuotaExceeded(Box<Quota>)
A Release B quota is used up (409/429 quota_exceeded, Cloud API
§8.1). Nothing is charged; monthly quotas are waited out (the outbox
keeps local work), counted ones need a person.
StorageFull(Box<StorageFull>)
The workspace’s LeanCTX Cloud storage is full (403 storage_quota_exceeded). Waiting does not free it: the background
sync parks the vault until a person frees storage or syncs by hand.
UploadRateLimited
The sliding-hour upload allowance is used up (429 upload_rate_limited). Transient: the rest goes out after
retry_after seconds (retry_after_s or the Retry-After header).
Fields
PolicyDenied(PolicyDenial)
Cloud’ own enforcement of a policy member refused (403 policy_denied, API §7.2). Never retried until the policy changes.
LeaseLapsed
The lease is past grace_until; reconnect.
Revoked(Revocation)
A workspace admin revoked this instance (401 instance_revoked, C0
2.0 E12). Recorded locally; no Cloud call is made until a new
connect (fail closed, never retried).
Forbidden
The lease lacks the right this request needs.
Vetoed
An organization veto bars this lease or handoff (forbidden_right,
reason: vetoed; C5c). Never retried until the veto is lifted.
UploadDisabled(CloudUploadKind)
The organization switched this upload off; stop it and drop its queue until a lease allows it again (never retried).
FeatureDisabled
The operator switched a feature off on this Cloud (404 feature_disabled, e.g. instance_metrics). Not an error of this
instance: what waits stays local, tried again much later.
NotFound
Conflict
ScreeningBlocked
UpgradeRequired
RateLimited
DeviceFlow(String)
The device flow ended without approval.
TrialUnsupported
cloud connect --trial against a Cloud that does not take the trial
members of the device code request yet (400 invalid_request). Never
retried without them: the person starts the trial on the web.
Protocol(String)
A response or stored artifact broke the contract (bad signature, wrong shape, unknown key).
Config(String)
Configuration that cannot work (URL scheme, root key).
Local(String)
Local storage failed.
Refused(String)
A local rule refused the request before it left (worker gate, outgoing screening); the message carries no content.
Task
Cloud refused a task request (C0 1.9 §1); number names the task.
Fields
refusal: TaskRefusalServer
Any other service answer.
Implementations§
Source§impl CloudError
impl CloudError
Sourcepub fn with_origin(self, origin: &str) -> Self
pub fn with_origin(self, origin: &str) -> Self
A plans page the service named as a path on its own origin
(402 trial_used, "/o/…") becomes a full address on origin, the
Cloud that answered. A full address is kept only on that same
origin (another host or an https→http downgrade is dropped like an
invalid one); without an http(s) origin nothing is shown.
Sourcepub fn for_trial(self) -> Self
pub fn for_trial(self) -> Self
A device code of a --trial connect that ran out: with a Cloud
that refuses a used trial only in the browser, the code just
expires, so the hint names the plans page instead of a new code.
Sourcepub fn with_plan(self, plan: CloudPlan) -> Self
pub fn with_plan(self, plan: CloudPlan) -> Self
A plan_required of a feature names the workspace’s plan as the
lease of the calling session says it; every other error is kept.
Sourcepub fn is_transient(&self) -> bool
pub fn is_transient(&self) -> bool
Whether retrying later can help (a 408 request timeout counts: the request never reached a verdict).
Sourcepub fn retry_after_at(&self, now: UtcDateTime) -> Option<u64>
pub fn retry_after_at(&self, now: UtcDateTime) -> Option<u64>
Seconds to wait before this may be tried again, when Cloud said so:
retry_after_s/Retry-After of a 429, else the time until a
waiting quota’s reset_at (seen from now).
Source§impl CloudError
impl CloudError
Sourcepub fn event_code(&self) -> String
pub fn event_code(&self) -> String
The code of a cloud connect --json error event: trial_used,
trial_unsupported, expired, denied, plan_required,
instance_limit, offline, unauthorized, rate_limited,
upgrade_required, config, protocol, local, the service’s own
code for any other answer, else error.
Trait Implementations§
Source§impl Clone for CloudError
impl Clone for CloudError
Source§impl Debug for CloudError
impl Debug for CloudError
Source§impl Display for CloudError
impl Display for CloudError
impl Eq for CloudError
Source§impl Error for CloudError
impl Error for CloudError
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()
Source§impl From<CloudError> for MapError
impl From<CloudError> for MapError
Source§fn from(error: CloudError) -> Self
fn from(error: CloudError) -> Self
Source§impl From<CloudError> for UnlinkError
impl From<CloudError> for UnlinkError
Source§fn from(error: CloudError) -> Self
fn from(error: CloudError) -> Self
Source§impl From<ConsentError> for CloudError
impl From<ConsentError> for CloudError
Source§fn from(error: ConsentError) -> Self
fn from(error: ConsentError) -> Self
Source§impl From<LocalError> for CloudError
impl From<LocalError> for CloudError
Source§fn from(e: LocalError) -> Self
fn from(e: LocalError) -> Self
Source§impl From<MapError> for CloudError
impl From<MapError> for CloudError
Source§impl From<Refusal> for CloudError
A refusal reaches the caller with its own (content-free) words.
impl From<Refusal> for CloudError
A refusal reaches the caller with its own (content-free) words.
Source§impl PartialEq for CloudError
impl PartialEq for CloudError
impl StructuralPartialEq for CloudError
Auto Trait Implementations§
impl Forget for CloudError
impl Freeze for CloudError
impl Move for CloudError
impl RefUnwindSafe for CloudError
impl Send for CloudError
impl Sync for CloudError
impl Unpin for CloudError
impl UnsafeUnpin for CloudError
impl UnwindSafe for CloudError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more