Skip to content

Commit

Permalink
Add user error for gracefully running out of memory
Browse files Browse the repository at this point in the history
As opposed to being killed by the JVM, which is a failure not a
user error.
  • Loading branch information
henrymercer committed May 8, 2024
1 parent ec11790 commit 45fb58a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/cli-errors.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/cli-errors.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/cli-errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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."),
Expand Down

0 comments on commit 45fb58a

Please sign in to comment.