Make error message tests less brittle

This commit is contained in:
Michael B. Gale
2025-10-29 08:29:11 +00:00
parent 53acf0b8aa
commit 194ba0ee2d
8 changed files with 34 additions and 10 deletions

5
lib/upload-lib.js generated
View File

@@ -82153,6 +82153,9 @@ function isEnablementError(msg) {
/Code Scanning is not enabled/
].some((pattern) => pattern.test(msg));
}
function getFeatureEnablementError(message) {
return `Please verify that the necessary features are enabled: ${message}`;
}
function wrapApiConfigurationError(e) {
const httpError = asHTTPError(e);
if (httpError !== void 0) {
@@ -82171,7 +82174,7 @@ function wrapApiConfigurationError(e) {
}
if (isEnablementError(httpError.message)) {
return new ConfigurationError(
`Please verify that the necessary features are enabled: ${httpError.message}`
getFeatureEnablementError(httpError.message)
);
}
if (httpError.status === 429) {