Skip to content

Commit 7c40d0f

Browse files
committed
Convert "Invalid source root" errors to UserErrors
1 parent 4cf8004 commit 7c40d0f

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

lib/init.js

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

lib/init.js.map

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

src/init.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,10 @@ export async function runInit(
117117
}
118118
}
119119
} catch (e) {
120-
// Handle the situation where init is called twice
121-
// for the same database in the same job.
120+
// Check if we need to re-throw the error as a UserError in order to avoid
121+
// counting this error towards our internal error budget.
122122
if (
123+
// Init action called twice
123124
e instanceof Error &&
124125
e.message?.includes("Refusing to create databases") &&
125126
e.message.includes("exists and is not an empty directory.")
@@ -129,7 +130,10 @@ export async function runInit(
129130
);
130131
} else if (
131132
e instanceof Error &&
132-
e.message?.includes("is not compatible with this CodeQL CLI")
133+
// Version of CodeQL CLI is incompatible with this version of the CodeQL Action
134+
(e.message?.includes("is not compatible with this CodeQL CLI") ||
135+
// Expected source location for database creation does not exist
136+
e.message?.includes("Invalid source root"))
133137
) {
134138
throw new util.UserError(e.message);
135139
} else {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy