Re-throw errors

This commit is contained in:
Robert Brignull
2020-08-12 18:00:01 +01:00
parent 150e07f914
commit 4b56177c28
6 changed files with 15 additions and 6 deletions

3
lib/upload-lib.js generated
View File

@@ -102,6 +102,9 @@ async function uploadPayload(payload, repositoryNwo, githubAuth, githubApiUrl, m
// Returns true iff the upload occurred and succeeded
async function upload(sarifPath, repositoryNwo, commitOid, ref, analysisKey, analysisName, workflowRunID, checkoutPath, environment, githubAuth, githubApiUrl, mode, logger) {
const sarifFiles = [];
if (!fs.existsSync(sarifPath)) {
throw new Error(`Path does not exist: ${sarifPath}`);
}
if (fs.lstatSync(sarifPath).isDirectory()) {
fs.readdirSync(sarifPath)
.filter(f => f.endsWith(".sarif"))