Add user error for gracefully running out of memory

As opposed to being killed by the JVM, which is a failure not a
user error.
This commit is contained in:
Henry Mercer
2024-05-08 13:21:10 +01:00
parent ec1179000d
commit 45fb58ab31
3 changed files with 9 additions and 1 deletions

View File

@@ -122,6 +122,7 @@ function ensureEndsInPeriod(text: string): string {
/** Error messages from the CLI that we consider configuration errors and handle specially. */
export enum CliConfigErrorCategory {
ExternalRepositoryCloneFailed = "ExternalRepositoryCloneFailed",
GracefulOutOfMemory = "GracefulOutOfMemory",
GradleBuildFailed = "GradleBuildFailed",
IncompatibleWithActionVersion = "IncompatibleWithActionVersion",
InitCalledTwice = "InitCalledTwice",
@@ -157,6 +158,9 @@ export const cliErrorsConfig: Record<
new RegExp("Failed to clone external Git repository"),
],
},
[CliConfigErrorCategory.GracefulOutOfMemory]: {
cliErrorMessageCandidates: [new RegExp("CodeQL is out of memory.")],
},
[CliConfigErrorCategory.GradleBuildFailed]: {
cliErrorMessageCandidates: [
new RegExp("[autobuild] FAILURE: Build failed with an exception."),