Skip to content

Commit 8271549

Browse files
committed
Make Java detection resilient to unusuable installs
Previously, if any Java failed to run completely (rather than running but exiting unsuccessfully) then spawnToResult would throw, so the test would throw, so the whole check would fail. Now we just treat errors like any other invalid exit.
1 parent a9b11df commit 8271549

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/interceptors/jvm.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const javaBinPromise: Promise<string | false> = (async () => {
3535
const javaTestResults = await Promise.all(javaBinPaths.map(async (possibleJavaBin) => ({
3636
javaBin: possibleJavaBin,
3737
output: await testJavaBin(possibleJavaBin)
38+
.catch((e) => ({ exitCode: -1, stdout: '', stderr: e.toString() }))
3839
})))
3940

4041
// Use the first Java in the list that succeeds:

0 commit comments

Comments
 (0)