#[non_exhaustive]pub enum ClientError {
Transport(TransportError),
Remote(RemoteError),
Decode {
content_type: Option<String>,
message: String,
},
Encode {
param: &'static str,
message: String,
},
InvalidName {
name: String,
reason: NameRefusal,
},
}Expand description
Everything that can go wrong on a typed client call — the call failing,
never the activation saying no (that is an err item).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Transport(TransportError)
The transport failed. See TransportError.
Remote(RemoteError)
The server answered with an error frame: the call failed — no such activation or method, bad params, not authenticated, not allowed, or the method blew up. Typed and exhaustive; match on it.
The frame’s recoverable flag is not carried (RETURNS-1 decision
9): an error frame ends the call either way.
Decode
The server’s answer does not fit the method’s declared contract: a
data item whose content does not deserialize into the method’s
item type, a progress item that does not deserialize into its
progress type, or a one-item method that sent no item or more than
one. A contract break between client and server (a renamed field, a
version skew); it terminates the stream.
Fields
Encode
An argument could not be serialized into the call’s params object, so nothing was sent. A generated client reports this rather than panicking — a panic in a wasm32 consumer is an unrecoverable trap.
InvalidName
RETURNS-46: a dynamic child’s instance name the service would route elsewhere than to that instance — so nothing was sent. Every call through the instance’s client, and through any client below it, is this, at once.
Fields
reason: NameRefusalWhy it cannot name an instance.
Implementations§
Source§impl ClientError
impl ClientError
Sourcepub fn is_transport(&self) -> bool
pub fn is_transport(&self) -> bool
true when the failure came from the transport rather than the peer.
Sourcepub fn remote(&self) -> Option<&RemoteError>
pub fn remote(&self) -> Option<&RemoteError>
The error frame’s RemoteError, when the call failed remotely.
Trait Implementations§
Source§impl Clone for ClientError
impl Clone for ClientError
Source§impl Debug for ClientError
impl Debug for ClientError
Source§impl Display for ClientError
impl Display for ClientError
Source§impl Error for ClientError
impl Error for ClientError
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()