Check for running out of disk space

This commit is contained in:
Henry Mercer 2025-02-20 16:18:19 +00:00
parent 8c69433c34
commit 0ae74e1ae0
3 changed files with 13 additions and 3 deletions

View file

@ -377,7 +377,13 @@ export async function setupCodeQL(
zstdAvailability,
};
} catch (e) {
throw new Error(
const ErrorClass =
e instanceof util.ConfigurationError ||
(e instanceof Error && e.message.includes("ENOSPC")) // out of disk space
? util.ConfigurationError
: Error;
throw new ErrorClass(
`Unable to download and extract CodeQL CLI: ${getErrorMessage(e)}${
e instanceof Error && e.stack ? `\n\nDetails: ${e.stack}` : ""
}`,