Refactoring: Simplify retrieving error message

This commit is contained in:
Henry Mercer 2024-09-16 22:38:35 +02:00
parent bbd7c801a0
commit dd7307d603
54 changed files with 106 additions and 89 deletions

4
lib/codeql.js generated
View file

@ -142,7 +142,7 @@ async function setupCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliV
};
}
catch (e) {
throw new Error(`Unable to download and extract CodeQL CLI: ${(0, util_1.wrapError)(e).message}`);
throw new Error(`Unable to download and extract CodeQL CLI: ${(0, util_1.getErrorMessage)(e)}`);
}
}
/**
@ -362,7 +362,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
const ErrorConstructor = e instanceof util.ConfigurationError
? util.ConfigurationError
: Error;
throw new ErrorConstructor(`${prefix} ${util.wrapError(e).message}`);
throw new ErrorConstructor(`${prefix} ${(0, util_1.getErrorMessage)(e)}`);
}
else {
throw e;