Skip to main content

Error

Enum Error 

Source
#[non_exhaustive]
#[repr(u32)]
pub enum Error {
Show 85 variants RemoteRpcError(String), UnknownRpcError = 101, InternalRpcError(Error), UuidError(Error), ConnectionNotFound = 203, NewConnectionError(Error), CloseConnectionError(Error), InvalidConnectionId = 206, CreateOffer(Error), AnswerOffer(Error), AcceptAnswer(Error), IncompatibleWireVersion(WireVersionMismatch), 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), InvalidUdpPortRange(UdpPortRangeError), IncompleteUdpPortRange { min: Option<u16>, max: Option<u16>, }, InvalidConfig(String), UninterpretableOnionService { service: OnionServiceName, }, BrowserStorageOpen { name: String, source: Error, }, RegistrationStopped = 815, MeasurementRuntime(MeasureRuntimeError), AdmissionTimedOut { peer: Did, }, HandshakePeerMismatch { expected: Did, actual: Did, }, HandshakeInFlight { peer: Did, }, SeedPeer(SeedPeerError), ConfigParse { path: PathBuf, source: Box<Error>, }, ConfigSerialize { path: PathBuf, source: Error, }, BrowserStorageLocked(String), InvalidBrowserStorageName(String), CreateFileError(String), OpenFileError(String), Lock = 902, HomeDirError = 903, ParentDirError = 904, PathUtf8Error(String), SerdeJsonError(Error), SerdeYamlError(Box<Error>), VerifyError(String), DelegationHorizonReached { expires_at_ms: u128, horizon_ms: u128, }, CoreError(Error), ExternalError(String), FFINulError(NulError), FFICStrError(Utf8Error), FFINulPtrError = 1_205, FFIFromUtf8Error(FromUtf8Error), BackendError(String), ExtensionError(String), DetachedTask(DetachedError), RuntimeUnavailable(RuntimeUnavailable), Timer(TimerError), ProviderStillShared { released: StoresReleased, }, OnionRouteError(OnionRouteError), OnionProxyIoError(String), OnionProxyRequestTimedOut = 1_603, OnionQueueAdmission { queue: OnionQueueKind, peer: Did, reason: OnionQueueAdmissionReason, }, OnionProxyTarget(OnionProxyTargetError), OnionTargetResolve { authority: String, source: Error, }, OnionTargetResolvedEmpty { authority: String, }, UnsafeRemoteRpcTarget(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.

§

IncompatibleWireVersion(WireVersionMismatch)

A handshake met a node of another wire version (#1104); over JSON-RPC its data is {"ours": n, "theirs": m}, with theirs null for a peer before wire versioning.

§

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.

§

InvalidUdpPortRange(UdpPortRangeError)

The configured local UDP port range is invalid.

§

IncompleteUdpPortRange

Only one side of the local 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.

§

UninterpretableOnionService

An onion exit offers a service this node’s runtime cannot interpret: a browser runtime has fetch but no sockets, so it interprets https only.

Fields

§service: OnionServiceName

The first offered service the runtime cannot interpret.

§

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.

§

AdmissionTimedOut

A handshake was accepted but the swarm did not admit the peer within the dial’s window.

Fields

§peer: Did

Peer the handshake was accepted with.

§

HandshakePeerMismatch

The endpoint answered as a DID other than the one the handshake was pinned to; no offer was created.

Fields

§expected: Did

DID the handshake was pinned to.

§actual: Did

DID the endpoint answered as.

§

HandshakeInFlight

A handshake was refused because the peer’s slot is owned by another attempt: a handshake in flight, whichever side started it.

Fields

§peer: Did

The peer whose slot is owned.

§

SeedPeer(SeedPeerError)

A seed entry failed validation.

§

ConfigParse

The node configuration file is not a valid config document: malformed YAML, a missing or unknown key, or a value of the wrong type.

Fields

§path: PathBuf

Config file that was read.

§source: Box<Error>

The parser’s error, with the key and source location, reported as this error’s source rather than in its message. Boxed as in Error::SerdeYamlError.

§

ConfigSerialize

Writing the node configuration to its file failed while serializing it.

Fields

§path: PathBuf

Config file that was written.

§source: Error

The serializer’s error, including any I/O error of the write, reported as this error’s source.

§

BrowserStorageLocked(String)

Another open browser node holds the exclusive Web Lock for this storage namespace (#1055): one storage namespace has one writer in the origin, so this open refuses before opening any IndexedDB database instead of interleaving with it.

§

InvalidBrowserStorageName(String)

A browser storage_name is empty or contains path separators or control characters, which could alias another namespace’s sub-store Web Lock (rings-node/<storage_name>/<substore>).

§

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(Box<Error>)

YAML deserialization failed. Boxed: the parser’s error carries its source location and snippet, and would otherwise make every Result of this crate as large.

§

VerifyError(String)

Cryptographic verification failed.

§

DelegationHorizonReached

The node’s own delegation is past its signing horizon (#1063): it expires at expires_at_ms, and every frame that carries it is refused from horizon_ms on, so the node can send nothing until it restarts with a fresh delegatee key.

Fields

§expires_at_ms: u128

The delegation’s expiry, in Unix epoch milliseconds.

§horizon_ms: u128

The first instant at which no frame leaves, in Unix epoch milliseconds.

§

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.

§

DetachedTask(DetachedError)

Owned detached work produced no result: it never started or ended without publishing.

§

RuntimeUnavailable(RuntimeUnavailable)

Work could not be scheduled because no async runtime is current.

§

Timer(TimerError)

The runtime could not run a timer.

§

ProviderStillShared

A closed node is still shared, so its stores are not yet released (Provider::close): they are once its last clone drops, which released witnesses.

Fields

§released: StoresReleased

Resolves once every store of the node is released.

§

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.

§

UnsafeRemoteRpcTarget(String)

A remote JSON-RPC URL failed the public-network egress policy.

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

Replaced by Error::source.
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<DetachedError> for Error

Source§

fn from(source: DetachedError) -> 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(error: Error) -> Self

Box the parser’s error into Error::SerdeYamlError.

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

Source§

fn from(error: OnionPipelineError) -> 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<RpcError> for Error

Source§

fn from(error: RpcError) -> Self

A remote node’s JSON-RPC call failed: transport, decoding or an error the node returned. The remote’s refusal of this node’s wire version is that refusal, as this node states it (Error::IncompatibleWireVersion).

Source§

impl From<RuntimeUnavailable> for Error

Source§

fn from(source: RuntimeUnavailable) -> Self

Converts to this type from the input type.
Source§

impl From<SeedPeerError> for Error

Source§

fn from(source: SeedPeerError) -> Self

Converts to this type from the input type.
Source§

impl From<TimerError> for Error

Source§

fn from(source: TimerError) -> Self

Converts to this type from the input type.
Source§

impl From<UdpPortRangeError> for Error

Source§

fn from(source: UdpPortRangeError) -> 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.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl !UnwindSafe for Error

§

impl Forget for Error

§

impl Freeze for Error

§

impl Move 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 + ?Sized,

Source§

impl<T> MaybeSendSync for T
where T: Send + Sync + ?Sized,

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