pub struct ErrorContext { /* private fields */ }Expand description
Identifies the command an Error belongs to.
A multiplexed client has many commands in flight at once, so an error that names none of them cannot be correlated to the application code that issued it. Every error the client raises on behalf of a command carries one of these.
Implementations§
Source§impl ErrorContext
impl ErrorContext
Sourcepub fn command(&self) -> &str
pub fn command(&self) -> &str
The name of the command the error belongs to, as sent on the wire
(GET, EVALSHA…).
In a pipeline or a transaction, an error that fails the batch as a whole — a timeout, a lost connection, a full send queue — is named after the batch’s first command, since all of them died together. An error born in the reply of one queued command is named after that command, and only when a single reply is awaited: past that, the batch deserializer reports on the whole tuple and does not say which element it stumbled on, so the error carries no command rather than the wrong one.