Skip to content

Exceptions

All exceptions are exported from the top-level data_harness package.


MaxTurnsExceeded

data_harness.MaxTurnsExceeded

MaxTurnsExceeded(
    turns: int,
    last_response: "NormalizedResponse | None" = None,
)

Bases: RuntimeError

Raised when the ReAct loop reaches max_turns without an end-turn stop.

Attributes:

Name Type Description
turns

The number of turns that were executed before the limit was hit.

last_response

The final provider response, if available.

Source code in data_harness/exceptions.py
def __init__(self, turns: int, last_response: "NormalizedResponse | None" = None):
    self.turns = turns
    self.last_response = last_response
    super().__init__(f"Max turns exceeded: {turns}")

ToolNotFoundError

data_harness.ToolNotFoundError

Bases: KeyError

Raised when a tool invocation names a tool that is not registered.


SubagentRecursionError

data_harness.SubagentRecursionError

Bases: RuntimeError

Raised when a subagent attempts to spawn another subagent.