← ClaudeAtlas

fabric-error-handlinglisted

Use when writing error handling in Fabric notebooks — the Tier 1 (setup, preconditions, hard-fail, raise immediately) vs Tier 2 (bulk operations, soft-fail, track per-item, print summary) convention. Covers the canonical `results = {succeeded, skipped, failed}` shape, the STRICT=False default for scheduled runs, STRICT=True for CI/orchestration, per-item metrics with a parallel per_item list, boundary rules (Tier 1 helpers may be called inside Tier 2 loops; don't wrap Tier 1 in try/except at the notebook level), and anti-patterns to avoid (silent continue, parallel bookkeeping lists).
wardawgmalvicious/claude-config · ★ 1 · AI & Automation · score 75
Install: claude install-skill wardawgmalvicious/claude-config
# Error handling convention (Fabric notebooks) Two tiers. Pick the right one per block of code; don't mix them inside a single logical operation. ## Tier 1 — Setup / preconditions (hard fail) Raise immediately. No try/except wrapping, no "best effort" semantics. Applies to: - Auth: token acquisition, Key Vault secret fetches, connection-string pulls - Required-config validation: missing required variables, unset placeholders that would produce invalid requests - Target resolution where the target is a single item: resolve a workspace ID, resolve an item ID, lookup the Variable Library GUID Tier 1 functions surface the cause in the exception message (HTTP status, what was missing, what was searched). They never swallow errors to keep the notebook running — if a precondition fails, subsequent cells will produce misleading output or worse, silent data corruption. ## Tier 2 — Bulk operations (soft fail) Track per-item results, continue the loop, print a summary at the end. Applies to: - Per-table maintenance (OPTIMIZE, VACUUM, TBLPROPERTIES alterations) - Per-item enumeration (list all items, extract GUIDs, update a set of value sets) - Per-workspace iteration Canonical result shape — use this exact structure in every Tier 2 notebook: ```python results = { "succeeded": [], # list[str] of item names "skipped": [], # list[dict]: {"name": str, "reason": str} "failed": [], # list[dict]: {"name": str, "error": str} } ``` Append into `succeeded` / `ski