pub enum ConnectionError {
Client(ClientErrorKind, String),
Server(Box<ErrorBody>),
}Expand description
Why a connection ended or could not be made: an error the client raised
(ClientError) or one the server sent (ProtocolError), together
ZeroError in packages/zero-client/src/client/error.ts.
Variants§
Client(ClientErrorKind, String)
An error the client raised, of a kind, with its message.
Server(Box<ErrorBody>)
An error the server sent.
Implementations§
Source§impl ConnectionError
impl ConnectionError
Sourcepub fn client(kind: ClientErrorKind, message: impl Into<String>) -> Self
pub fn client(kind: ClientErrorKind, message: impl Into<String>) -> Self
An error the client raised.
Sourcepub fn client_kind(&self) -> Option<ClientErrorKind>
pub fn client_kind(&self) -> Option<ClientErrorKind>
The kind of an error the client raised.
Sourcepub fn server_kind(&self) -> Option<ErrorKind>
pub fn server_kind(&self) -> Option<ErrorKind>
The kind of an error the server sent.
Sourcepub fn is_zero_error(&self) -> bool
pub fn is_zero_error(&self) -> bool
isZeroError: a client error, or a server error that says where it
came from. Older servers send errors without an origin.
Sourcepub fn is_auth_error(&self) -> bool
pub fn is_auth_error(&self) -> bool
isAuthError: the server rejected the credentials, or the API server
answered a push or transform with 401 or 403.
Sourcepub fn is_transport_failure(&self) -> bool
pub fn is_transport_failure(&self) -> bool
isTransportFailure: the socket closed or never answered, rather
than the server replying. These carry no backoff instructions and
usually clear within seconds, so they are retried on the fast
schedule.
Sourcepub fn state_description(&self) -> &'static str
pub fn state_description(&self) -> &'static str
How a rejected mutation describes the client (getStateDescription).
Trait Implementations§
Source§impl Clone for ConnectionError
impl Clone for ConnectionError
Source§impl Debug for ConnectionError
impl Debug for ConnectionError
Source§impl Display for ConnectionError
impl Display for ConnectionError
Source§impl Error for ConnectionError
impl Error for ConnectionError
1.30.0 · 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()