pub struct Error(_);
Expand description

The type of errors returned by Ockam functions.

Errors store:

  • A set of error codes, which abstractly describe the problem and allow easily matching against specific categories of error.
  • An open-ended payload, to which arbitrary data can be attached.
  • The “cause”, of this error, if it has not been lost to serialization.
  • Various debugging information, such as a backtrace and spantrace (which is lost over serialization).

Implementations

Construct a new error given ErrorCodes and a cause.

Construct a new error with “unknown” error codes.

This ideally should not be used inside Ockam.

Construct a new error without an apparent cause

This constructor should be used for any error occurring because of a None unwrap.

Return the codes that identify this error.

Attach additional unstructured informaton to the error.

Trait Implementations

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

🔬 This is a nightly-only experimental API. (error_generic_member_access)

Provides type based access to context intended for error reports. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Decode a slice.

Encode the type into an Encoded type.

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

The type of the wrapped error after instrumentation

Instrument an Error by bundling it with a SpanTrace Read more

Calls U::from(self).

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

Should always be Self

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more