Skip to content

Surface chrome webstore error details - #113

Merged
fregante merged 3 commits into
fregante:mainfrom
Adichapati:fix/better-cwserror-details
May 28, 2026
Merged

fregante merged 3 commits into
fregante:mainfrom
Adichapati:fix/better-cwserror-details

Conversation

@Adichapati

Copy link
Copy Markdown
Contributor

Summary

  • add shared CWSError handler and detail extraction
  • surface field violations/localized messages in CLI output
  • cover handler + detail parsing with tests

Test Plan

  • npm test

- Add shared CWSError handler with detail extraction
- Print field violations and localized messages when present
- Cover handler and detail parsing with tests
Copilot AI review requested due to automatic review settings May 14, 2026 08:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 handleError implementation plus extractDetailLines parsing 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 thread source/error-handler.js
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 thread source/error-handler.js
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}`);
}
}
@fregante

fregante commented May 14, 2026

Copy link
Copy Markdown
Owner

@Adichapati

Copy link
Copy Markdown
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).

@fregante fregante changed the title fix: surface chrome webstore error details Surface chrome webstore error details May 28, 2026
@fregante fregante added the bug label May 28, 2026
@fregante
fregante merged commit 1211df6 into fregante:main May 28, 2026
3 checks passed
@fregante

Copy link
Copy Markdown
Owner

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

❌ The uploaded package was invalid. Check the additional details for more information.

3 participants