You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scoped runtime error handling for a feature component that runs its own query. Contains failure to the component's own DOM so the rest of the page keeps working. Catches both render errors and query fetch errors through a single wrapper.
11
+
12
+
### Constraints
13
+
14
+
- Only for components with their own **query hook**.
15
+
-`ErrorBoundary` and `withErrorBoundary` live in `src/lib/components/ErrorBoundary/`. Use `withErrorBoundary` by default — do not hand-roll.
16
+
- Add `throwOnError: true` on the query's `useQuery` call in `providers/`.
Copy file name to clipboardExpand all lines: specs/lessons.md
-12Lines changed: 0 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,15 +41,3 @@ Patterns captured after corrections. Review at session start.
41
41
**Source:** Correction 2026-04-12 — `MarketingProductDto` leaked into `ProductDetails.tsx` component props.
42
42
43
43
---
44
-
45
-
## L004 — Missing `error-boundary` building block
46
-
47
-
**Rule:** Feature components embedded inside pages (e.g. `ProductRating` inside `ProductPage`) need scoped error handling so their failure doesn't blank the whole page — an "island" error boundary. The pattern should cover both React render errors and React Query errors (`useQuery({ throwOnError })` composed with `QueryErrorResetBoundary`) in one consistent wrapper. No typed block exists for this in `.agents/skills/building-blocks/SKILL.md`, so specs either skip scoped error UI or reinvent it per feature.
48
-
49
-
**Why it failed:** Spec 005 needed `ProductRating` to degrade gracefully if the marketing query failed, but no canonical pattern existed — the spec deferred error handling entirely rather than ship a one-off.
50
-
51
-
**How to apply:** When a spec introduces a feature-level component mounted inside a page, ask whether its failure should blank the page or render a scoped fallback. If scoped, flag the `island-error-boundary` gap and defer the error UI rather than inventing one. When the block is added, it should wrap `react-error-boundary` + `QueryErrorResetBoundary`, surface a `fallback` prop, and standardize the treatment of render vs. query errors.
52
-
53
-
**Source:** Spec 005 Q1 — rating component error UI deferred because no canonical island-error pattern existed.
0 commit comments