Exceptions — swarph_mesh.exceptions

Public exception hierarchy. Third-party adapter implementations should raise these (not bare Exception) when surfacing errors via LLMAdapter.chat().

Exception hierarchy for swarph-mesh.

exception swarph_mesh.exceptions.SwarphMeshError[source]

Bases: Exception

Base for all swarph-mesh errors. Catch this if you want to handle every failure class uniformly.

exception swarph_mesh.exceptions.AdapterError[source]

Bases: SwarphMeshError

An adapter call failed. error_class on the LLMResponse carries the categorical failure reason; this exception type carries the original exception chain for callers who want to react to specific provider failures.

exception swarph_mesh.exceptions.UnknownProvider[source]

Bases: SwarphMeshError

Raised when SwarphCall is invoked with a provider string that has no registered adapter. Phase 1+ ships adapters incrementally — pre-Phase-N callers can hit this for providers that haven’t landed yet.