mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 17:41:28 +00:00
Improve function name
This commit is contained in:
7
lib/upload-lib.js
generated
7
lib/upload-lib.js
generated
@@ -332,7 +332,7 @@ async function waitForProcessing(repositoryNwo, sarifID, logger, options = {
|
||||
}
|
||||
else if (status === "failed") {
|
||||
const message = `Code Scanning could not process the submitted SARIF file:\n${response.data.errors}`;
|
||||
throw areProcessingErrorsUserError(response.data.errors)
|
||||
throw shouldConsiderAsUserError(response.data.errors)
|
||||
? new util_1.UserError(message)
|
||||
: new Error(message);
|
||||
}
|
||||
@@ -349,7 +349,10 @@ async function waitForProcessing(repositoryNwo, sarifID, logger, options = {
|
||||
}
|
||||
}
|
||||
exports.waitForProcessing = waitForProcessing;
|
||||
function areProcessingErrorsUserError(processingErrors) {
|
||||
/**
|
||||
* Returns whether the provided processing errors should be considered a user error.
|
||||
*/
|
||||
function shouldConsiderAsUserError(processingErrors) {
|
||||
return (processingErrors.length === 1 &&
|
||||
processingErrors[0] ===
|
||||
"CodeQL analyses from advanced configurations cannot be processed when the default setup is enabled");
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -473,7 +473,7 @@ export async function waitForProcessing(
|
||||
break;
|
||||
} else if (status === "failed") {
|
||||
const message = `Code Scanning could not process the submitted SARIF file:\n${response.data.errors}`;
|
||||
throw areProcessingErrorsUserError(response.data.errors as string[])
|
||||
throw shouldConsiderAsUserError(response.data.errors as string[])
|
||||
? new UserError(message)
|
||||
: new Error(message);
|
||||
} else {
|
||||
@@ -489,7 +489,10 @@ export async function waitForProcessing(
|
||||
}
|
||||
}
|
||||
|
||||
function areProcessingErrorsUserError(processingErrors: string[]): boolean {
|
||||
/**
|
||||
* Returns whether the provided processing errors should be considered a user error.
|
||||
*/
|
||||
function shouldConsiderAsUserError(processingErrors: string[]): boolean {
|
||||
return (
|
||||
processingErrors.length === 1 &&
|
||||
processingErrors[0] ===
|
||||
|
||||
Reference in New Issue
Block a user