APR-200: Surface scan errors via PackageResult.error field#55
Open
JacobSampson wants to merge 1 commit into
Open
APR-200: Surface scan errors via PackageResult.error field#55JacobSampson wants to merge 1 commit into
JacobSampson wants to merge 1 commit into
Conversation
When a per-package desloppify scan fails, the catch block previously logged via console.error and pushed an empty result with no way for callers to distinguish a failure from a genuine zero-issue scan. Adds optional `error?: string` to PackageResult, sets it in the catch block, and surfaces it in the CLI summary output. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
error?: stringto thePackageResultinterface so callers can distinguish a failed scan from a successful scan with zero issuesrunner.tsto seterror: String(err)on the resultformatSummaryin the CLI to display the error when presentChanges
packages/devtools/src/desloppify/types.ts: addederror?: stringtoPackageResultpackages/devtools/src/desloppify/runner.ts: catch block now populateserrorfield (line 269)packages/devtools/src/commands/desloppify.ts:formatSummaryrendersError: ...for failed packagespackages/devtools/src/__tests__/runner.test.ts: two new tests using a mockedexecSync— one for the error path, one confirming the happy-path result has noerrorfieldTest Plan
runDesloppifyScansetsresult.packages[n].errorwhenexecSyncthrowsrunDesloppifyScandoes not seterroron a successful scan with zero issuespnpm test)pnpm typecheck)pnpm lint)Closes: APR-200
🤖 Generated with Claude Code