Add rough error handler for Octokit response parsing failures to `1.x` and `2.x` release

Open
#265 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, node.js
Domain
api, devops

Research direction

Start by reviewing #258 and the linked request.js PR 648, then locate the response-parsing path used by the 1.x and 2.x releases. Confirm how Node 16 compatibility constrains the workaround; done means non-JSON or empty error responses no longer produce misleading parsing errors in Actions logs.

Written by the indexing model from the issue text.

Description

This is intended as the 1.x and 2.x equivalent to shipping:

  • #258

Addressing #258 will resolve misleading error scenarios where the error message that shows up in the Actions logs says something like HttpError: invalid json response body and reason: Unexpected end of JSON input. This occurs when Octokit receives a response with an error code (e.g. 400) but the accompanying response text is either not JSON-compatible for parsing, or is just not provided at all (empty).

This was resolved in Octokit with the following PR:

However, the subsequent Octokit release is not compatible with Node 16.x, and therefore cannot be pulled in as a dependency until we merge #256 and cut a new 3.x release.

Sadly, a new 3.x release won't help all of our GHES customers.

Therefore, we should consider implementing a rough workaround fix (i.e. a catch watching for this exact error) in this scenario so we log fewer "red herring" error messages. 🐟

Dominant language
JavaScript
Stars
967
Forks
147
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from actions/deploy-pages

All issues in actions/deploy-pages

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.