#[non_exhaustive]pub enum Error {
Show 17 variants
Protocol(Error),
InvalidUrl(ParseError),
InvalidUrlScheme(String),
Http(Arc<Error>),
#[non_exhaustive] HttpStatus {
status: u16,
message: Option<String>,
},
ProxyFailed(String),
#[non_exhaustive] WebsocketClosed {
code: u16,
reason: String,
},
Websocket(Arc<Error>),
InvalidHandshake(String),
NotConnected,
UpgradeUnavailable,
UpgradeFailed(&'static str),
PingTimeout,
Timeout(Duration),
TlsNotEnabled(String),
TlsProviderMissing,
InvalidTlsConfig(String),
}Expand description
Everything that can go wrong in the engine.io client.
Errors never contain the request URL: query strings often carry tokens, so reqwest
errors are stored without their URL.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Protocol(Error)
A packet broke the engine.io wire format.
InvalidUrl(ParseError)
The server URL does not parse.
InvalidUrlScheme(String)
The URL scheme is not http, https, ws or wss.
Http(Arc<Error>)
An HTTP request (polling transport) failed: connection refused, DNS, TLS, timeout, …
#[non_exhaustive]HttpStatus
The server answered a polling request with a non-200 status (400 “Session ID unknown” after a server restart, 403 from a proxy, …).
Fields
This variant is marked as non-exhaustive
ProxyFailed(String)
The HTTP proxy refused or broke the CONNECT tunnel (never shows the proxy URL).
#[non_exhaustive]WebsocketClosed
The server closed the websocket with a close frame (code and reason as sent).
Fields
This variant is marked as non-exhaustive
Websocket(Arc<Error>)
The websocket failed to open or broke.
InvalidHandshake(String)
The handshake (0{...} open packet) is missing or malformed. An Engine.IO v3 server
answers in a format this v4 client does not speak.
NotConnected
emit before connect or after the connection closed.
The handshake did not offer websocket in upgrades (server or proxy allows polling only).
UpgradeFailed(&'static str)
The websocket upgrade probe (2probe / 3probe) failed.
PingTimeout
No ping from the server within pingInterval + pingTimeout: the link is dead.
Timeout(Duration)
The handshake or websocket connect took longer than the timeout.
TlsNotEnabled(String)
https/wss without a TLS feature.
TlsProviderMissing
Another crate in the build turned on reqwest’s rustls-no-provider feature (e.g.
tauri-plugin-updater), so reqwest wants a rustls crypto provider that nobody installed.
InvalidTlsConfig(String)
The TLS configuration could not be built (bad PEM, unsupported protocol versions).
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()