Skip to main content

HiveErrorCode

Enum HiveErrorCode 

Source
pub enum HiveErrorCode {
Show 22 variants AuthorizationPending, SlowDown, ExpiredToken, AccessDenied, InvalidRequest, Unauthorized, PlanRequired, ForbiddenRight, UploadDisabled, NotFound, FeatureDisabled, InstanceLimit, RevisionConflict, InvalidState, LeaseExpired, ScreeningRequired, RateLimited, UpgradeRequired, InstanceRevoked, QuotaExceeded, PolicyDenied, Unknown,
}
Expand description

Machine-readable error code. Unknown codes from a newer service decode as HiveErrorCode::Unknown and are handled by HTTP status.

Variants§

§

AuthorizationPending

400, device flow: the user has not approved yet; poll again after interval.

§

SlowDown

400, device flow: polling too fast; add 5 s to the interval.

§

ExpiredToken

400, device flow: the device code expired; start again.

§

AccessDenied

400, device flow: the user refused.

§

InvalidRequest

400: body failed validation or carried unknown fields.

§

Unauthorized

401: access token missing, expired or not for this instance.

§

PlanRequired

402: the organization’s plan does not include Hive.

§

ForbiddenRight

403: the lease lacks the right this route needs.

§

UploadDisabled

403 with kind (1.4): the organization switched this upload off. Stop that kind of upload and drop its queue until a lease allows it.

§

NotFound

404: unknown instance, vault, proposal or lease.

§

FeatureDisabled

404 with feature (Hive API.md “feature switches”): the operator switched this feature off on this Hive (instance_metrics while HIVE_ENGINE_METRICS is off). The route exists; try again much later.

§

InstanceLimit

409 with limit/used: every instance seat is taken.

§

RevisionConflict

409 with expected/actual: knowledge moved on.

§

InvalidState

409 with reason (1.5): the object is not in a state that allows this.

§

LeaseExpired

401: the instance lease is past grace_until; renew or reconnect.

§

ScreeningRequired

422: the service screening refused content the engine should have removed.

§

RateLimited

429 with retry_after_s.

§

UpgradeRequired

426 with min_instance (also in the Hive-Min-Instance header).

§

InstanceRevoked

401 with revocation (C0 2.0 E12, §3.17.3): a workspace admin revoked this instance; every engine route answers it until a new connect. Never retried.

§

QuotaExceeded

Release B quotas (Hive API §8.1): resource, limit, used, reset_at. Counted resources (registered_instances, private_vaults) answer 409 (registered_instances in Personal adds cooldown_days, reset_at = when a cooling-down slot frees); monthly ones (transfer_bytes, bus_messages) answer 429 with retry_after_s and Retry-After until reset_at. Never overage: the engine waits, its outbox keeps local work.

§

PolicyDenied

403 with member (dotted policy path) and level (the outermost level whose document refuses; consent refusals add action): Hive itself enforces an x-enforcement: server policy member (§7.2).

§

Unknown

Any code this engine does not know.

Implementations§

Source§

impl HiveErrorCode

Source

pub fn http_status(self) -> u16

HTTP status the service answers with for this code.

Trait Implementations§

Source§

impl Clone for HiveErrorCode

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for HiveErrorCode

Source§

impl Debug for HiveErrorCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for HiveErrorCode

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for HiveErrorCode

Source§

impl Hash for HiveErrorCode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for HiveErrorCode

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for HiveErrorCode

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for HiveErrorCode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.