-
Notifications
You must be signed in to change notification settings - Fork 4
fix(check): user-error handling overhaul — file filters, error boundaries, UserError guards #467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9c7ba33
fix(check): stop miscategorizing out-of-root file filters as crashes
rhuanbarreto 85c7420
fix(rules): address review — flag implicit-return actions and parse f…
rhuanbarreto 27c1443
refactor(check): throw UserError from guards instead of logError + ex…
rhuanbarreto c08a670
docs(memory): record UserError-in-guards review preference
rhuanbarreto 301c2d6
refactor(commands): sweep logError+exitWith(1) guards into UserError …
rhuanbarreto b7051c8
fix(helpers): reunite findProjectRoot JSDoc with its function
rhuanbarreto 076f6fb
fix: address review — actionable adr-show error, ARCH-011 markdown sp…
rhuanbarreto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
12 changes: 12 additions & 0 deletions
12
.claude/agent-memory/archgate-developer/feedback_throw_usererror_in_guards.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| name: feedback-throw-usererror-in-guards | ||
| description: In command actions with a full error boundary, throw UserError instead of manual logError + exitWith(1) | ||
| metadata: | ||
| type: feedback | ||
| --- | ||
|
|
||
| In command actions whose body is fully wrapped in try/catch → `handleCommandError`, early-return guards should `throw new UserError(...)` rather than `logError(...) + await exitWith(1) + return`. | ||
|
|
||
| **Why:** User review feedback on PR #467 (both guards in `check.ts`). The boundary already does logError + exit 1 without Sentry for UserError — the manual triple is redundant ceremony and drifts from the `user-error.ts` doctrine ("helpers throw UserError"). | ||
|
|
||
| **How to apply:** When adding or touching a guard inside a boundary-wrapped action, prefer the throw. Note the test-shape difference: the exit spy then sees `exitWith(1, { errorKind: "user" })`, not `exitWith(1)`. Don't mass-convert other commands unprompted — apply opportunistically when editing them. |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.