feat: implement error inheritance model for access codes#1228
Merged
Conversation
Render resource error pages in two parts: first the errors that belong to the resource itself (matching `is_<resource>_error`), grouped by variant group as before; then, for each parent resource whose errors the resource inherits (other `is_<parent>_error` flags), a single flat group per parent (variant groups ignored), headed by the parent's noun. Errors that carry no resource flag remain the resource's own errors, and unmanaged resources reuse their managed counterpart's flag (`is_access_code_error`), so their own errors are identified correctly. On the access code pages, inherited errors are limited to the ungrouped and Locks variant groups; device categories like thermostats are not relevant there. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TgmnJeFSgiQhfptLskubdh
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Use the blueprint's `variant.resourceType` field (added in @seamapi/blueprint 0.56.0) to split a resource's errors into its own and inherited groups, replacing the `is_<resource>_error` marker-property parsing. Each error names exactly one owning resource, so inherited errors group cleanly under a single parent and never appear twice. This corrects two cases the marker approach got wrong: `acs_system` errors (e.g. `bridge_disconnected`) are its own, not inherited from a bridge; and errors that carried several markers (e.g. `account_disconnected`, `bridge_disconnected`) no longer duplicate across parent groups. Bumps @seamapi/blueprint to ^0.56.0 for the field. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TgmnJeFSgiQhfptLskubdh
Each inherited-error group now opens with a <Note> explaining that the codes belong to a parent resource and are surfaced here when set on it, linking to the parent resource's own errors page. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TgmnJeFSgiQhfptLskubdh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implement a new error grouping model for resources that inherit errors from parent resources. This change reorganizes error documentation to show a resource's own errors first (grouped by variant group), followed by inherited errors from parent resources (in flat groups per parent).
Key Changes
New
variantsToEntries()helper function — Extracted common logic for converting variants to sorted code entries, used by bothgroupCodes()and the newgroupErrorCodes()function.New
groupErrorCodes()function — Implements the inheritance model:is_<resourceType>_error) by variant group, matching the existinggroupCodes()behavioris_<parent>_errorflags) into flat groups per parent, with parent resource names as headingsNew
resourceTypeNoun()helper — Converts resource type identifiers (e.g.,connected_account) into display nouns (e.g.,Connected Account) for inherited error group headings.Configuration for inheritance — Added
INHERITED_ERROR_GROUP_ALLOWLISTto define which variant groups are relevant for each resource type, andinheritanceResourceTypeoption toErrorPageOptions.Updated error page generation — Modified
writeErrorPage()to usegroupErrorCodes()wheninheritanceResourceTypeis specified, enabling the inheritance model for per-resource pages while preserving the existing behavior for device sub-category pages.Regenerated error documentation — Access code and device error pages now display errors organized by the inheritance model, with own errors first (sorted alphabetically), followed by inherited errors grouped by parent resource (Bridge, Connected Account, Device).
Implementation Details
https://claude.ai/code/session_01TgmnJeFSgiQhfptLskubdh