Skip to main content

Module error

Module error 

Source
Expand description

The error type of every connector call and the rule for what to do with each error.

One enum, Error, for all brokers. A connector maps everything its broker or network can say into one of nine variants, so the code that handles errors does not depend on the broker. Error::class gives the coarse answer to “may I try again”: see ErrorClass.

The one variant that needs care is Error::Unknown. It says that a command (place, cancel, replace) may or may not have reached the broker. Never repeat the command after it: look at the order first, see Error::Unknown.

Enums§

ConfigError
A configuration problem: a value that is missing, malformed, or of the wrong kind for this broker.
Error
What can go wrong in a connector call.
ErrorClass
The coarse answer to “may I try this call again”: see Error::class.
TransportError
A network-level problem: connect, TLS, timeout of a read, a broken stream, a malformed answer.

Constants§

NOT_FOUND
The code of an Error::Rejected that says “the broker does not know this”: an order, a cid, an instrument. The same string at every broker, so a caller compares with == and needs no case folding.