refactor(cli): convert modify.ts and add.ts to typed error flow#281
Open
galligan wants to merge 2 commits into
Open
refactor(cli): convert modify.ts and add.ts to typed error flow#281galligan wants to merge 2 commits into
galligan wants to merge 2 commits into
Conversation
Contributor
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Feb 22, 2026
Replace throw new Error(...) with typed contract errors (ValidationError, NotFoundError) in modify and add command handlers. Update Result.tryPromise catch handlers to preserve error category instead of wrapping all errors as InternalError. 🤘🏻 In-collaboration-with: [Claude Code](https://claude.com/claude-code)
Convert throws in init.ts, remove.ts, scan.ts, update.ts, fmt.ts, lint.ts, check.ts, and doctor.ts to use typed contract errors (ValidationError, InternalError) instead of generic Error. Update all Result.tryPromise catch handlers to preserve error categories via AnyKitError duck-typing. 🤘🏻 In-collaboration-with: [Claude Code](https://claude.com/claude-code)
8a4de2f to
8eb153a
Compare
aa7415d to
16bb9a7
Compare
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.

refactor(cli): convert modify.ts and add.ts to typed error flow
Replace throw new Error(...) with typed contract errors
(ValidationError, NotFoundError) in modify and add command handlers.
Update Result.tryPromise catch handlers to preserve error category
instead of wrapping all errors as InternalError.
🤘🏻 In-collaboration-with: Claude Code
refactor(cli): convert remaining CLI handlers to typed error flow
Convert throws in init.ts, remove.ts, scan.ts, update.ts, fmt.ts,
lint.ts, check.ts, and doctor.ts to use typed contract errors
(ValidationError, InternalError) instead of generic Error. Update all
Result.tryPromise catch handlers to preserve error categories via
AnyKitError duck-typing.
🤘🏻 In-collaboration-with: Claude Code
Greptile Summary
Refactored CLI command handlers to use typed error flow instead of generic
Errorthrows. Replacedthrow new Error(...)withValidationError,NotFoundError, andInternalErrorfrom@outfitter/contracts. Updated allResult.tryPromisecatch handlers to preserve error categories using duck-typing pattern ("category" in cause) instead of wrapping everything asInternalError.Key changes across 10 files:
ValidationError.fromMessage()orValidationError.create(field, message)NotFoundError.create(type, identifier, context?)"category"property to preserve typed errorsResult<T, InternalError>toResult<T, AnyKitError>Confidence Score: 5/5
Important Files Changed
Last reviewed commit: 16bb9a7