dist: Address Copilot review suggestions from PR #1042 (GraalVM Community) (#1059)

- installer: surface a clear error when the GraalVM Community releases
  listing is not a JSON array, instead of silently treating an error
  payload (rate limit, auth failure, etc.) as "no releases" which later
  surfaced as a misleading "version not found" error.
- docs: fix the GraalVM Community advanced-usage example to check the
  installed binary versions (java/native-image --version) rather than
  running a non-existent HelloWorldApp classpath that fails when copied.
- tests: cover the new non-array release listing error path.

Rebuilt dist bundle.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Bruno Borges
2026-06-23 13:37:44 -04:00
committed by GitHub
parent fa2c6508d1
commit 1bcf9fb12c
4 changed files with 41 additions and 4 deletions
@@ -1058,6 +1058,20 @@ describe('GraalVMDistribution', () => {
'GraalVM Community does not provide early access builds'
);
});
it('should surface an error when the releases listing is not an array', async () => {
mockHttpClient.getJson.mockResolvedValue({
result: {message: 'API rate limit exceeded'},
statusCode: 403,
headers: {}
});
await expect(
(communityDistribution as any).findPackageForDownload('21')
).rejects.toThrow(
/Unexpected response while listing GraalVM Community releases.*HTTP status code: 403/s
);
});
});
});
});