Skip to content

Commit 47fa622

Browse files
committed
Make EACCES a ConfigurationError
1 parent 45693cc commit 47fa622

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

lib/entry-points.js

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/codeql.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ test("isDiskConfigurationError - true for expected errors", async (t) => {
5555
t.true(
5656
codeql.isDiskConfigurationError(new Error("ENOSPC: Out of disk space")),
5757
);
58+
t.true(
59+
codeql.isDiskConfigurationError(
60+
new Error(
61+
"EACCES: permission denied, mkdir /opt/hostedtoolcache/CodeQL/",
62+
),
63+
),
64+
);
5865
});
5966

6067
test("isDiskConfigurationError - false for other errors", async (t) => {

src/codeql.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,12 @@ export function isDiskConfigurationError(e: unknown): boolean {
285285
return false;
286286
}
287287

288-
return e.message.includes("ENOSPC"); // out of disk space
288+
return (
289+
// out of disk space
290+
e.message.includes("ENOSPC") ||
291+
// access denied
292+
e.message.includes("EACCES")
293+
);
289294
}
290295

291296
/**

0 commit comments

Comments
 (0)