Surface chrome webstore error details - #113
Merged
Merged
Conversation
- Add shared CWSError handler with detail extraction - Print field violations and localized messages when present - Cover handler and detail parsing with tests
There was a problem hiding this comment.
Pull request overview
This PR centralizes Chrome Web Store error handling so the CLI can surface richer error details (e.g., field violations, localized messages) when chrome-webstore-upload returns structured error payloads.
Changes:
- Added a shared
handleErrorimplementation plusextractDetailLinesparsing for Chrome Web Store API error details. - Updated the CLI to use the shared error handler.
- Updated/added AVA tests for the error handler and detail parsing.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| source/error-handler.js | Introduces shared CWSError handling and extraction of detail lines for display. |
| source/cli.js | Replaces the in-file error handler with the shared handleError. |
| source/error-handler.test.js | Refactors existing error output tests to call handleError and adds tests for detail extraction. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+35
to
+41
| if (typeof detail.message === 'string') { | ||
| lines.push(detail.message); | ||
| continue; | ||
| } | ||
|
|
||
| if (typeof detail.reason === 'string') { | ||
| lines.push(detail.reason); |
Comment on lines
+54
to
+60
| const detailLines = extractDetailLines(error.details); | ||
| if (detailLines.length > 0) { | ||
| console.error('Details:'); | ||
| for (const line of detailLines) { | ||
| console.error(`- ${line}`); | ||
| } | ||
| } |
Owner
Contributor
Author
|
Yes—this PR addresses issue #112. I also pushed a small follow-up commit to handle string-only error details (with a test). |
Owner
|
thank you! |
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
Test Plan