Skip to main content

Error

Enum Error 

Source
#[non_exhaustive]
#[repr(u32)]
pub enum Error {
Show 70 variants RemoteRpcError(String), UnknownRpcError = 101, InternalRpcError(Error), UuidError(Error), ConnectionNotFound = 203, NewConnectionError(Error), CloseConnectionError(Error), InvalidConnectionId = 206, CreateOffer(Error), AnswerOffer(Error), AcceptAnswer(Error), DecodeError = 300, EncodeError = 301, WasmCompileError(String), WasmBackendMessageRwLockError = 401, WasmInstantiationError = 402, WasmExportError = 403, WasmRuntimeError(String), WasmGlobalMemoryLockError = 405, WasmFailedToLoadFile = 406, InvalidDid(String), InvalidMethod = 501, InternalError(Error), NoPermission = 504, ConnectError(Error), SendMessage(Error), EntryError(Error), ServiceRegisterError(Error), JsError(String), InvalidMessage = 800, HttpRequestError(String), InvalidData = 802, InvalidService = 803, InvalidAddress = 804, InvalidAuthData = 805, InvalidHeaders = 806, Storage(Error), Swarm(Error), InvalidLoggingLevel(String), InvalidWebrtcUdpPortRange(WebrtcUdpPortRangeError), IncompleteWebrtcUdpPortRange { min: Option<u16>, max: Option<u16>, }, InvalidConfig(String), BrowserStorageOpen { name: String, source: Error, }, RegistrationStopped = 815, MeasurementRuntime(MeasureRuntimeError), CreateFileError(String), OpenFileError(String), Lock = 902, HomeDirError = 903, ParentDirError = 904, PathUtf8Error(String), SerdeJsonError(Error), SerdeYamlError(Error), VerifyError(String), CoreError(Error), ExternalError(String), FFINulError(NulError), FFICStrError(Utf8Error), FFINulPtrError = 1_205, FFIFromUtf8Error(FromUtf8Error), BackendError(String), ExtensionError(String), DetachedExtensionTaskClosed = 1_503, OnionRouteError(OnionRouteError), OnionProxyIoError(String), OnionProxyRequestTimedOut = 1_603, OnionQueueAdmission { queue: OnionQueueKind, peer: Did, reason: OnionQueueAdmissionReason, }, OnionProxyTarget(OnionProxyTargetError), OnionTargetResolve { authority: String, source: Error, }, OnionTargetResolvedEmpty { authority: String, },
}
Expand description

Errors enum mapping global custom errors. The error type can be expressed in decimal, where the high decs represent the error category and the low decs represent the error type.

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.
§

RemoteRpcError(String)

Connecting to a remote JSON-RPC server failed.

§

UnknownRpcError = 101

A remote JSON-RPC error did not match a known local variant.

§

InternalRpcError(Error)

The internal JSON-RPC dispatcher returned an error.

§

UuidError(Error)

UUID parsing or formatting failed.

§

ConnectionNotFound = 203

The requested connection does not exist in the local swarm.

§

NewConnectionError(Error)

Opening a new connection through the core swarm failed.

§

CloseConnectionError(Error)

Closing an existing connection through the core swarm failed.

§

InvalidConnectionId = 206

The supplied connection identifier is malformed or unknown.

§

CreateOffer(Error)

Creating WebRTC offer data failed.

§

AnswerOffer(Error)

Creating WebRTC answer data failed.

§

AcceptAnswer(Error)

Accepting WebRTC answer data failed.

§

DecodeError = 300

Decoding structured data failed.

§

EncodeError = 301

Encoding structured data failed.

§

WasmCompileError(String)

Compiling a WASM artifact failed.

§

WasmBackendMessageRwLockError = 401

Acquiring the WASM backend-message lock failed.

§

WasmInstantiationError = 402

Instantiating a WASM module failed.

§

WasmExportError = 403

Resolving a required WASM export failed.

§

WasmRuntimeError(String)

Executing WASM code returned a runtime error.

§

WasmGlobalMemoryLockError = 405

Acquiring the WASM global memory lock failed.

§

WasmFailedToLoadFile = 406

Loading a WASM input file failed.

§

InvalidDid(String)

Parsing or validating a DID failed.

§

InvalidMethod = 501

The requested JSON-RPC method is not supported.

§

InternalError(Error)

A core internal operation failed.

§

NoPermission = 504

The caller is not authorized to perform the requested action.

§

ConnectError(Error)

Connecting to a peer failed.

§

SendMessage(Error)

Sending a peer message failed.

§

EntryError(Error)

Applying a DHT entry action failed.

§

ServiceRegisterError(Error)

Registering a service descriptor failed.

§

JsError(String)

JavaScript host code returned an error.

§

InvalidMessage = 800

A protocol message failed validation.

§

HttpRequestError(String)

An HTTP proxy request failed validation.

§

InvalidData = 802

Input data failed semantic validation.

§

InvalidService = 803

A service name or service descriptor is invalid.

§

InvalidAddress = 804

A network address is invalid.

§

InvalidAuthData = 805

Authentication payload data is invalid.

§

InvalidHeaders = 806

Request headers are missing required values or contain invalid values.

§

Storage(Error)

Persistent or cache storage returned an error.

§

Swarm(Error)

Swarm state management returned an error.

§

InvalidLoggingLevel(String)

The requested logging level is not supported.

§

InvalidWebrtcUdpPortRange(WebrtcUdpPortRangeError)

The configured WebRTC UDP port range is invalid.

§

IncompleteWebrtcUdpPortRange

Only one side of the WebRTC UDP port range was configured.

Fields

§min: Option<u16>

Configured lower UDP port bound.

§max: Option<u16>

Configured upper UDP port bound.

§

InvalidConfig(String)

The node configuration is structurally invalid.

§

BrowserStorageOpen

Opening browser IndexedDB-backed provider storage failed.

Fields

§name: String

IndexedDB database and object-store name requested by the browser provider.

§source: Error

Storage backend error returned while opening the database.

§

RegistrationStopped = 815

A periodic registration task observed a cooperative stop request.

§

MeasurementRuntime(MeasureRuntimeError)

Loading or explicitly flushing local peer measurements failed.

§

CreateFileError(String)

Creating a file on disk failed.

§

OpenFileError(String)

Opening a file on disk failed.

§

Lock = 902

Acquiring a synchronization lock failed.

§

HomeDirError = 903

The process home directory could not be resolved.

§

ParentDirError = 904

The parent directory of a path could not be resolved.

§

PathUtf8Error(String)

A filesystem path cannot be represented as UTF-8.

§

SerdeJsonError(Error)

JSON serialization or deserialization failed.

§

SerdeYamlError(Error)

YAML serialization or deserialization failed.

§

VerifyError(String)

Cryptographic verification failed.

§

CoreError(Error)

A rings-core operation returned an error.

§

ExternalError(String)

An external signer returned an error.

§

FFINulError(NulError)

An FFI string contained an interior nul byte.

§

FFICStrError(Utf8Error)

Converting an FFI C string to UTF-8 failed.

§

FFINulPtrError = 1_205

An FFI pointer argument was null.

§

FFIFromUtf8Error(FromUtf8Error)

Converting owned FFI bytes to UTF-8 failed.

§

BackendError(String)

A protocol backend returned an error.

§

ExtensionError(String)

An extension runtime returned an error.

§

DetachedExtensionTaskClosed = 1_503

An owned extension task ended before publishing its result.

§

OnionRouteError(OnionRouteError)

Onion route construction or validation failed.

§

OnionProxyIoError(String)

Onion proxy I/O failed.

§

OnionProxyRequestTimedOut = 1_603

A local onion proxy request did not complete before its deadline.

§

OnionQueueAdmission

A bounded onion or relay send queue rejected one item.

Fields

§queue: OnionQueueKind

Queue whose bound was reached.

§peer: Did

Peer whose item was rejected.

§reason: OnionQueueAdmissionReason

Exact admission relation that failed.

§

OnionProxyTarget(OnionProxyTargetError)

An onion proxy authority failed closed parsing.

§

OnionTargetResolve

Runtime DNS resolution of an admitted onion target failed.

Fields

§authority: String

Canonical target authority.

§source: Error

Resolver I/O failure.

§

OnionTargetResolvedEmpty

Runtime DNS resolution returned no addresses.

Fields

§authority: String

Canonical target authority.

Implementations§

Source§

impl Error

Source

pub fn code(&self) -> u32

Returns the stable numeric error code for JSON-RPC error conversion.

Trait Implementations§

Source§

impl Debug for Error

Source§

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

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

impl Display for Error

Source§

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

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

impl Error for Error

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<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(e: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(e: Error) -> Self

Converts to this type from the input type.
Source§

impl From<FromUtf8Error> for Error

Source§

fn from(source: FromUtf8Error) -> Self

Converts to this type from the input type.
Source§

impl From<MeasureRuntimeError> for Error

Source§

fn from(source: MeasureRuntimeError) -> Self

Converts to this type from the input type.
Source§

impl From<NulError> for Error

Source§

fn from(source: NulError) -> Self

Converts to this type from the input type.
Source§

impl From<OnionProxyTargetError> for Error

Source§

fn from(source: OnionProxyTargetError) -> Self

Converts to this type from the input type.
Source§

impl From<Utf8Error> for Error

Source§

fn from(source: Utf8Error) -> Self

Converts to this type from the input type.
Source§

impl From<WebrtcUdpPortRangeError> for Error

Source§

fn from(source: WebrtcUdpPortRangeError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl !UnwindSafe for Error

§

impl Freeze for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

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> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T> MaybeSend for T
where T: Send + Sync,

Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToSmolStr for T
where T: Display + ?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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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