#[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
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
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: OnionServiceNameThe first offered service the runtime cannot interpret.
BrowserStorageOpen
Opening browser IndexedDB-backed provider storage failed.
Fields
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.
HandshakePeerMismatch
The endpoint answered as a DID other than the one the handshake was pinned to; no offer was created.
HandshakeInFlight
A handshake was refused because the peer’s slot is owned by another attempt: a handshake in flight, whichever side started it.
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
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
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
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.
Work could not be scheduled because no async runtime is current.
Timer(TimerError)
The runtime could not run a timer.
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.
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: OnionQueueKindQueue whose bound was reached.
reason: OnionQueueAdmissionReasonExact admission relation that failed.
OnionProxyTarget(OnionProxyTargetError)
An onion proxy authority failed closed parsing.
OnionTargetResolve
Runtime DNS resolution of an admitted onion target failed.
OnionTargetResolvedEmpty
Runtime DNS resolution returned no addresses.
Fields
Canonical target authority.
UnsafeRemoteRpcTarget(String)
A remote JSON-RPC URL failed the public-network egress policy.
Implementations§
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<DetachedError> for Error
impl From<DetachedError> for Error
Source§fn from(source: DetachedError) -> Self
fn from(source: DetachedError) -> Self
Source§impl From<Error> for Error
impl From<Error> for Error
Source§fn from(error: Error) -> Self
fn from(error: Error) -> Self
Box the parser’s error into Error::SerdeYamlError.
Source§impl From<FromUtf8Error> for Error
impl From<FromUtf8Error> for Error
Source§fn from(source: FromUtf8Error) -> Self
fn from(source: FromUtf8Error) -> Self
Source§impl From<MeasureRuntimeError> for Error
impl From<MeasureRuntimeError> for Error
Source§fn from(source: MeasureRuntimeError) -> Self
fn from(source: MeasureRuntimeError) -> Self
Source§impl From<OnionPipelineError> for Error
impl From<OnionPipelineError> for Error
Source§fn from(error: OnionPipelineError) -> Self
fn from(error: OnionPipelineError) -> Self
Source§impl From<OnionProxyTargetError> for Error
impl From<OnionProxyTargetError> for Error
Source§fn from(source: OnionProxyTargetError) -> Self
fn from(source: OnionProxyTargetError) -> Self
Source§impl From<RpcError> for Error
impl From<RpcError> for Error
Source§fn from(error: RpcError) -> Self
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§fn from(source: RuntimeUnavailable) -> Self
fn from(source: RuntimeUnavailable) -> Self
Source§impl From<SeedPeerError> for Error
impl From<SeedPeerError> for Error
Source§fn from(source: SeedPeerError) -> Self
fn from(source: SeedPeerError) -> Self
Source§impl From<TimerError> for Error
impl From<TimerError> for Error
Source§fn from(source: TimerError) -> Self
fn from(source: TimerError) -> Self
Source§impl From<UdpPortRangeError> for Error
impl From<UdpPortRangeError> for Error
Source§fn from(source: UdpPortRangeError) -> Self
fn from(source: UdpPortRangeError) -> Self
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> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T> MaybeSend for T
impl<T> MaybeSendSync for T
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.