Add OS info to the error message

This commit is contained in:
MaksimZhukov 2022-12-05 18:34:56 +01:00
parent 1aafadcfb9
commit 6c87c81bbd
3 changed files with 104 additions and 4 deletions

View file

@ -1,6 +1,6 @@
import * as os from 'os';
import * as path from 'path';
import {IS_WINDOWS, IS_LINUX} from './utils';
import {IS_WINDOWS, IS_LINUX, getOSInfo} from './utils';
import * as semver from 'semver';
@ -85,9 +85,10 @@ export async function useCpythonVersion(
}
if (!installDir) {
const osInfo = await getOSInfo();
throw new Error(
[
`Version ${version} with arch ${architecture} not found`,
`Version ${version} with arch ${architecture} not found for ${osInfo}`,
`The list of all available versions can be found here: ${installer.MANIFEST_URL}`
].join(os.EOL)
);