Skip to main content
Every error derives from SoryError, so one except covers the library:

The ones you will actually hit

Building the client raises LicenceError or FeeError immediately — both mean a mistake in the config, and both are better found now than mid-session.
Sending an order raises ConfigError for a shape that cannot work, and CapabilityError when a venue cannot do what you asked:
A CapabilityError is always a refusal, never a downgrade. SORY will not send your order without the thing you asked for.

What is not an error

A partial fill is not an error, and neither is a venue dropping out. Those come back as data:
A slice too small for one venue is re-routed to another rather than raised. You only get a RoutingError when nothing could be allocated anywhere — and its message names every venue that was considered and why each was skipped.

Logging

Every error is logged before it is raised, with the function that produced it. Point the log wherever you want: