Only print the full error message in debug mode

This commit is contained in:
Henry Mercer 2022-12-02 14:38:40 +00:00
Родитель e0ff272230
Коммит 375dacad24
3 изменённых файлов: 17 добавлений и 15 удалений

11
lib/upload-lib.js сгенерированный
Просмотреть файл

@ -346,10 +346,13 @@ function handleProcessingResultForUnsuccessfulExecution(response, status, logger
'"unsuccessful execution" error, and no other errors.');
}
else {
throw new Error(`${"Failed to upload a SARIF file for the unsuccessful execution. Code scanning status " +
"information for the repository may be out of date as a result. "}${status === "failed"
? `Processing errors: ${response.data.errors}`
: 'Encountered no processing errors, but expected to receive an "unsuccessful execution" error.'}`);
const shortMessage = "Failed to upload a SARIF file for the unsuccessful execution. Code scanning status " +
"information for the repository may be out of date as a result.";
const longMessage = shortMessage + status === "failed"
? ` Processing errors: ${response.data.errors}`
: ' Encountered no processing errors, but expected to receive an "unsuccessful execution" error.';
logger.debug(longMessage);
throw new Error(shortMessage);
}
}
function validateUniqueCategory(sarif) {

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -488,16 +488,15 @@ function handleProcessingResultForUnsuccessfulExecution(
'"unsuccessful execution" error, and no other errors.'
);
} else {
throw new Error(
`${
"Failed to upload a SARIF file for the unsuccessful execution. Code scanning status " +
"information for the repository may be out of date as a result. "
}${
status === "failed"
? `Processing errors: ${response.data.errors}`
: 'Encountered no processing errors, but expected to receive an "unsuccessful execution" error.'
}`
);
const shortMessage =
"Failed to upload a SARIF file for the unsuccessful execution. Code scanning status " +
"information for the repository may be out of date as a result.";
const longMessage =
shortMessage + status === "failed"
? ` Processing errors: ${response.data.errors}`
: ' Encountered no processing errors, but expected to receive an "unsuccessful execution" error.';
logger.debug(longMessage);
throw new Error(shortMessage);
}
}