Skip to main content

ErrorData

Enum ErrorData 

Source
pub enum ErrorData {
Show 18 variants KeyInvalid { reason: String, }, StatementMalformed { reason: String, }, WrongKind { expected: String, actual: String, }, WrongProject { expected: String, actual: String, }, WrongInstall { expected: String, actual: String, }, WrongChannel { expected: String, actual: String, }, SignatureRefused { signer: String, reason: String, }, Unsigned { role: String, }, Expired { not_after: String, }, Denied { digest: String, }, SignerListRefused { version: u64, reason: String, }, SignerListMissing { needed: u64, current: u64, }, SettingsInvalid { reason: String, }, SettingsUndecided { reason: String, }, TrustRootChanged { accepted: String, found: String, }, LedgerRefused { reason: String, }, WorkloadRefused { workload: String, reason: String, }, BodyRefused { kind: String, reason: String, },
}
Expand description

Why a statement, signer list, setting, ledger or workload was refused.

Every variant is a refusal an enforcer reports back to whoever sent the input, so none of them is internal.

Variants§

§

KeyInvalid

A key is not a valid ECDSA P-256 key in the expected encoding.

Fields

§reason: String

What is wrong with the key.

§

StatementMalformed

The bytes are not a well-formed signed statement.

Fields

§reason: String

What is wrong with the statement.

§

WrongKind

The statement is of another kind than the one expected.

Fields

§expected: String

Kind the caller asked for.

§actual: String

Kind the statement declares.

§

WrongProject

The statement names another project.

Fields

§expected: String

Project of the pinned signer list.

§actual: String

Project the statement names.

§

WrongInstall

The statement names another install, or none where one is required.

Fields

§expected: String

This install, or none for project-wide kinds.

§actual: String

Install the statement names, or none.

§

WrongChannel

A release is for another channel than the one setup pinned.

Fields

§expected: String

Channel setup pinned.

§actual: String

Channel the release names.

§

SignatureRefused

A signature does not verify, or names a signer that may not sign.

Fields

§signer: String

Signer id the signature names.

§reason: String

Why it was refused.

§

Unsigned

The statement carries no signature that counts.

Fields

§role: String

Role the statement’s kind requires.

§

Expired

The statement’s notAfter has passed.

Fields

§not_after: String

When it stopped being valid, RFC 3339.

§

Denied

The statement’s digest is on the signer list’s deny-list.

Fields

§digest: String

Digest of the statement payload.

§

SignerListRefused

A signer list does not extend the trusted chain.

Fields

§version: u64

Version the refused list claims.

§reason: String

Why it was refused.

§

SignerListMissing

The statement was signed against a signer list version the enforcer has not been given.

Fields

§needed: u64

Version the statement names.

§current: u64

Highest version the enforcer trusts.

§

SettingsInvalid

The signing settings setup wrote are malformed or contradict where they were found.

Fields

§reason: String

What is wrong with the settings.

§

SettingsUndecided

Whether this install is protected can’t be decided from what the enforcer could read, so it runs nothing new.

Fields

§reason: String

What the enforcer saw.

§

TrustRootChanged

The install accepted signed state under one trust root and now finds another, or none. Only a local operator command resets it.

Fields

§accepted: String

The fingerprint or install id the install accepted state under.

§found: String

What it finds now, or none.

§

LedgerRefused

The install’s ledger is missing, malformed or forks from what this enforcer holds.

Fields

§reason: String

Why.

§

WorkloadRefused

A workload asked for something its signed release does not allow.

Fields

§workload: String

Workload name.

§reason: String

Why it was refused.

§

BodyRefused

A statement body breaks a rule of its kind.

Fields

§kind: String

Statement kind.

§reason: String

Why it was refused.

Trait Implementations§

Source§

impl AlienErrorData for ErrorData

Source§

fn code(&self) -> &'static str

Short machine-readable identifier (“NOT_FOUND”, “TIMEOUT”, …).
Source§

fn retryable(&self) -> bool

Whether the failing operation can be retried.
Source§

fn internal(&self) -> bool

Whether the error is internal (should not be shown to end users).
Source§

fn http_status_code(&self) -> u16

HTTP status code for this error (defaults to 500).
Source§

fn message(&self) -> String

Human-readable message (defaults to Display).
Source§

fn hint(&self) -> Option<String>

Optional actionable hint for human-facing CLI output.
Source§

fn context(&self) -> Option<Value>

Optional diagnostic payload built from struct/enum fields.
Source§

fn retryable_inherit(&self) -> Option<bool>

Whether to inherit the retryable flag from the source error. Returns None if this error should inherit from source, Some(value) for explicit value.
Source§

fn internal_inherit(&self) -> Option<bool>

Whether to inherit the internal flag from the source error. Returns None if this error should inherit from source, Some(value) for explicit value.
Source§

fn http_status_code_inherit(&self) -> Option<u16>

Whether to inherit the HTTP status code from the source error. Returns None if this error should inherit from source, Some(value) for explicit value.
Source§

fn human_layer_presentation(&self) -> HumanLayerPresentation

Controls whether this error layer should be shown in the default human CLI renderer.
Source§

impl Clone for ErrorData

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 Debug for ErrorData

Source§

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

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

impl<'de> Deserialize<'de> for ErrorData

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 Display for ErrorData

Source§

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

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

impl Eq for ErrorData

Source§

impl PartialEq for ErrorData

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 ErrorData

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 ErrorData

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.