pub enum WebSocketError {
Connect(Error),
Handshake(WebSocketError),
InvalidDomain(InvalidDnsNameError),
MissingHost,
TlsStream(Error),
TlsConfig(Error),
BuildRequest(Error),
UnsupportedScheme(String),
Runtime(WebSocketError),
}Expand description
Errors that surface from the streamer transport (TCP / TLS / WebSocket handshake plus any frame-level error after the socket is up).
Variants§
Connect(Error)
TCP connect failed.
Handshake(WebSocketError)
WebSocket upgrade handshake failed.
InvalidDomain(InvalidDnsNameError)
streamerSocketUrl host is not a valid DNS name.
MissingHost
streamerSocketUrl did not include a host component.
TlsStream(Error)
TLS handshake failed on top of the TCP socket.
TlsConfig(Error)
Building the rustls client config failed.
BuildRequest(Error)
Building the HTTP upgrade request failed.
UnsupportedScheme(String)
streamerSocketUrl used a scheme that is not permitted for the
current build. wss:// is always accepted; ws:// is accepted
only in debug builds, because a plaintext WebSocket would carry
the bearer token in the LOGIN frame in the clear. Any other
scheme (or a URL with no scheme at all) is always rejected.
Runtime(WebSocketError)
Runtime frame error after the websocket is up: read/write/control
frame failures from fastwebsockets.
Implementations§
Source§impl WebSocketError
impl WebSocketError
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Whether a fresh connect (and re-login) is worth attempting after
this error. Returns false for configuration-shaped failures that
will fail identically on retry (bad scheme, missing host, malformed
upgrade request, rustls config error) and true for transport- or
session-level failures (TCP connect, TLS handshake, WebSocket
handshake, post-handshake frame errors).
Used by crate::Error::is_retryable to classify
crate::Error::WebSocket.
Trait Implementations§
Source§impl Debug for WebSocketError
impl Debug for WebSocketError
Source§impl Display for WebSocketError
impl Display for WebSocketError
Source§impl Error for WebSocketError
impl Error for WebSocketError
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()