Skip to content
Claude Certified Architect – Foundations (CCAR-F) Exam Prep

Lesson 27 of 30 · 6 min

x
27/30

Error Propagation

Video lesson: CCAR-F 27/30: Error Propagation

What the platform does

  • A subagent returns only its final message to its parent. Intermediate tool failures stay inside it unless that final message reports them. So a subagent's report must state failures and gaps explicitly.
  • An API error that ends a subagent early (for example a rate limit) is never delivered as its result; the SDK has defined foreground and background behaviour for it.
  • A subagent that reaches maxTurns returns output marked partial, and it can be resumed.
  • PostToolUseFailure hooks fire on tool failure; SubagentStop hooks fire on completion, a place to log and aggregate.
  • Limits exist on spend, depth and concurrency; hitting maxBudgetUsd ends the query with error_max_budget_usd (1.2).

Principles (design guidance)

  1. Never suppress silently. A swallowed error becomes a confident wrong answer. Surface what failed.
  2. Structured error context from subagent to coordinator: what was attempted, what failed (category, retryable), what partial results exist, and what is still unknown.
  3. Partial results with coverage annotations. If 8 of 10 sources were read, say so ("sources 4 and 9 were unavailable"), do not present the answer as complete.
  4. Local recovery first, then propagate. Retry transient failures in place (2.2); only propagate what the subagent cannot fix.
  5. Do not terminate everything for one failure when the task can still produce a useful partial answer; do not continue as if nothing happened when a critical step failed.
  6. Coordinator decides. With the structured context, it can retry, route to another subagent, accept partial output with a caveat, or escalate (5.2).

Example report from a research subagent

status: partial · completed: 8/10 sources · failed: [{source: "S4", category: "timeout", retryable: true}, {source: "S9", category: "permission", retryable: false}] · findings: [...] · unknowns: ["pricing for vendor B"]

Exam traps

  • A subagent that returns "no results" for a failure.
  • Aborting the whole pipeline on one non-critical failure.
  • The coordinator presenting partial work as complete.
  • Error text only for humans (no category or retryable flag for code).
  • Assuming an API error reaches the parent as a result. It does not.

References

  1. Subagents in the SDK — checked Oct 16, 2026
  2. Hooks in the SDK — checked Oct 16, 2026

Check your understanding

  • Two of ten sources fail. What should the final answer include?Show answer

    Answer

    The findings plus a clear note of which sources were unavailable and what remains unknown.
  • What reaches the coordinator from a subagent?Show answer

    Answer

    Its final message, so it must contain the error context.
  • A transient timeout in a tool. Handle locally or propagate?Show answer

    Answer

    Retry locally first (bounded); propagate if it persists.
Previous

Progress is saved in this browser.

Next Lesson