#[non_exhaustive]pub enum Error {
Engine(Error),
ThreadNotStarted {
reason: String,
},
HostStopped,
ResultLost,
Payload(Error),
Transport(Error),
ControlFrameTooLarge {
bytes: usize,
limit: usize,
},
}Expand description
A failure from the host, as distinct from a failure from the engine.
The two are worth telling apart. An Engine error means the
engine refused the work and the host is still serving; the other variants
mean the host itself is unavailable, and retrying the same request will not
help.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Engine(Error)
The engine refused the work. The host is unaffected.
ThreadNotStarted
The engine thread could not be started.
HostStopped
The engine thread has stopped, so no further work can be run.
Terminal for this host: build a new one.
ResultLost
The work was submitted but the thread ended before answering.
Payload(Error)
A message’s object payload could not be turned into data.
Separate from Engine because the engine answered
perfectly well: what failed was rendering the tree it handed over, and
the rest of the message is still worth delivering.
Transport(Error)
The socket carrying events failed.
Separate again from Engine: the engine is fine and the
run is unaffected, only the listener is unreachable. A host may well
choose to keep testing and stop reporting.
ControlFrameTooLarge
A control frame payload exceeded what the protocol allows.
RFC 6455 section 5.5 caps every control frame at 125 bytes. A peer that receives a larger one fails the connection, and the send that caused it reports success, so this is raised before the frame goes out.
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()