Skip to content

Remove superfluous HttpError: Not Found from error output#195

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-http-error-handling
Draft

Remove superfluous HttpError: Not Found from error output#195
Copilot wants to merge 2 commits intomainfrom
copilot/fix-http-error-handling

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 2, 2026

When Pages is not enabled (common with forks), users see a duplicate error — the helpful message from core.error() followed by a raw HttpError: Not Found from core.setFailed() re-catching the thrown error:

Error: Get Pages site failed. Please verify that the repository has Pages enabled...
Error: HttpError: Not Found

The second line adds no information.

Changes

  • src/api-client.js: Replace core.error(msg) + throw error pattern with throw new Error(msg) across all three error paths in findOrCreatePagesSite. The user-friendly message propagates to core.setFailed() in index.js directly, eliminating the duplicate raw HTTP error output.
  • src/api-client.test.js: Update error assertions to check error.message content instead of error.response.status, matching the new Error objects.

Instead of logging a detailed error with core.error() and then re-throwing
the raw HTTP error (which gets logged again by core.setFailed() in index.js),
throw a new Error with the user-friendly message directly. This eliminates
the duplicate/superfluous raw error output like "HttpError: Not Found".

Fixes #125

Agent-Logs-Url: https://github.com/actions/configure-pages/sessions/ee6b7f39-cfc5-415b-b70c-826c2b8cfcfe

Co-authored-by: yoannchaudet <14911070+yoannchaudet@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix superfluous HttpError: Not Found message Remove superfluous HttpError: Not Found from error output Apr 2, 2026
Copilot AI requested a review from yoannchaudet April 2, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HttpError: Not Found is superfluous (and unhelpful)

2 participants