Add configuration error for failing to clone external Git repo

This commit is contained in:
Henry Mercer 2024-04-19 19:44:05 +01:00
parent 82edfe29ce
commit 1be8c488eb
3 changed files with 13 additions and 1 deletions

6
lib/cli-errors.js generated
View file

@ -116,6 +116,7 @@ function ensureEndsInPeriod(text) {
/** Error messages from the CLI that we consider configuration errors and handle specially. */ /** Error messages from the CLI that we consider configuration errors and handle specially. */
var CliConfigErrorCategory; var CliConfigErrorCategory;
(function (CliConfigErrorCategory) { (function (CliConfigErrorCategory) {
CliConfigErrorCategory["ExternalRepositoryCloneFailed"] = "ExternalRepositoryCloneFailed";
CliConfigErrorCategory["GradleBuildFailed"] = "GradleBuildFailed"; CliConfigErrorCategory["GradleBuildFailed"] = "GradleBuildFailed";
CliConfigErrorCategory["IncompatibleWithActionVersion"] = "IncompatibleWithActionVersion"; CliConfigErrorCategory["IncompatibleWithActionVersion"] = "IncompatibleWithActionVersion";
CliConfigErrorCategory["InitCalledTwice"] = "InitCalledTwice"; CliConfigErrorCategory["InitCalledTwice"] = "InitCalledTwice";
@ -134,6 +135,11 @@ var CliConfigErrorCategory;
* would like to categorize an error as a configuration error or not. * would like to categorize an error as a configuration error or not.
*/ */
exports.cliErrorsConfig = { exports.cliErrorsConfig = {
[CliConfigErrorCategory.ExternalRepositoryCloneFailed]: {
cliErrorMessageCandidates: [
new RegExp("Failed to clone external Git repository"),
],
},
[CliConfigErrorCategory.GradleBuildFailed]: { [CliConfigErrorCategory.GradleBuildFailed]: {
cliErrorMessageCandidates: [ cliErrorMessageCandidates: [
new RegExp("[autobuild] FAILURE: Build failed with an exception."), new RegExp("[autobuild] FAILURE: Build failed with an exception."),

File diff suppressed because one or more lines are too long

View file

@ -121,6 +121,7 @@ function ensureEndsInPeriod(text: string): string {
/** Error messages from the CLI that we consider configuration errors and handle specially. */ /** Error messages from the CLI that we consider configuration errors and handle specially. */
export enum CliConfigErrorCategory { export enum CliConfigErrorCategory {
ExternalRepositoryCloneFailed = "ExternalRepositoryCloneFailed",
GradleBuildFailed = "GradleBuildFailed", GradleBuildFailed = "GradleBuildFailed",
IncompatibleWithActionVersion = "IncompatibleWithActionVersion", IncompatibleWithActionVersion = "IncompatibleWithActionVersion",
InitCalledTwice = "InitCalledTwice", InitCalledTwice = "InitCalledTwice",
@ -150,6 +151,11 @@ export const cliErrorsConfig: Record<
CliConfigErrorCategory, CliConfigErrorCategory,
CliErrorConfiguration CliErrorConfiguration
> = { > = {
[CliConfigErrorCategory.ExternalRepositoryCloneFailed]: {
cliErrorMessageCandidates: [
new RegExp("Failed to clone external Git repository"),
],
},
[CliConfigErrorCategory.GradleBuildFailed]: { [CliConfigErrorCategory.GradleBuildFailed]: {
cliErrorMessageCandidates: [ cliErrorMessageCandidates: [
new RegExp("[autobuild] FAILURE: Build failed with an exception."), new RegExp("[autobuild] FAILURE: Build failed with an exception."),