Skip to main content

DppError

Enum DppError 

Source
#[non_exhaustive]
pub enum DppError { NotFound(String), InvalidTransition { current: String, required: String, }, Validation(ValidationErrors), Signing(String), Serialisation(String), RemovedEnvelopeKey { removed: &'static str, replacement: &'static str, }, SchemaIncompatible(UpcastError), RetentionLocked, SuccessionUnresolvable { id: String, reason: String, }, Internal(String), }
Expand description

Top-level error type for the DPP domain.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

NotFound(String)

§

InvalidTransition

Fields

§current: String
§required: String
§

Validation(ValidationErrors)

§

Signing(String)

§

Serialisation(String)

§

RemovedEnvelopeKey

A stored document carries an envelope key this build has removed, so it predates a rename. Reading it would succeed while silently dropping the field, which is why it is refused instead. See crate::passport::REMOVED_ENVELOPE_KEYS.

Fields

§removed: &'static str

The key as the stored document spells it.

§replacement: &'static str

The key that replaced it.

§

SchemaIncompatible(UpcastError)

A stored document’s product group data predates the current schema by more than the registered lens chain can bridge — e.g. a required field the document was written before, with no source data anywhere to derive it from. Not a bug to fix by writing a lens: some gaps have no honest transform. See crate::schemas::lens.

§

RetentionLocked

Returned when an attempt is made to delete or overwrite a passport that has been published and is therefore subject to EU ESPR retention obligations. Published passports must remain accessible for the legally defined period under the applicable delegated act (typically 10–15 years).

§

SuccessionUnresolvable

The forward walk from a passport to the record that replaced it could not produce one answer.

Distinct from Ok(None), which is the ordinary “nothing supersedes this” and is not an error. This is the store holding a shape the succession edge does not permit — two records claiming one predecessor, a cycle, or a chain longer than the walk will follow. Each is a reason the question has no answer rather than a negative one, and returning the first-sorted row instead would answer “which record am I holding” wrongly and silently.

Fields

§id: String

The passport the walk started from.

§reason: String

Which of the three shapes was met.

§

Internal(String)

Trait Implementations§

Source§

impl Debug for DppError

Source§

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

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

impl Display for DppError

Source§

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

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

impl Error for DppError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<UpcastError> for DppError

Source§

fn from(source: UpcastError) -> Self

Converts to this type from the input type.
Source§

impl From<ValidationErrors> for DppError

Source§

fn from(errors: ValidationErrors) -> Self

Converts to this type from the input type.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.