pub enum Error<I, O>where
I: SocketInput,
O: SocketOutput,
Message: TryFrom<I>,
<Message as TryFrom<I>>::Error: Debug,
<O as TryFrom<Message>>::Error: Debug,{
WebSocketError(WebSocketError),
JsError(JsError),
InvalidConfig(String),
InputError(<Message as TryFrom<I>>::Error),
OutputError(<O as TryFrom<Message>>::Error),
}
Expand description
Errors returned by crate::Socket
and crate::SocketBuilder
Variants§
WebSocketError(WebSocketError)
Errors from the underlying gloo::net::websocket::futures::WebSocket
These are unlikely to be fatal, they mostly express various ways the websocket has disconnected or encountered an error that requires reconnecting
JsError(JsError)
Javascript errors returned by either crate::get_proto_and_host
or the underlying
gloo::net::websocket::futures::WebSocket
These errors are often fatal errors like the URL provided is invalid, the port is
firewalled or other miscellaneous errors from the browser. Look at
gloo::net::websocket::futures::WebSocket::open
to work out what the cases are and
how to handle them
InvalidConfig(String)
Invalid configuration provided to crate::SocketBuilder
These errors are only returned from the bulder and are all fatal
InputError(<Message as TryFrom<I>>::Error)
Input errors returned by the consumers implementation of <crate::Message
as
TryFrom<I>
>
If these errors are fatal is dependent on consumers implementation of TryFrom<I>
OutputError(<O as TryFrom<Message>>::Error)
Output errors returned by the consumers implementation of <O as TryFrom<Message>
>
If these errors are fatal is dependent on consumers implementation of TryFrom<Message>