From 1032141ebd84945eed09831feceb5c034f5d40c0 Mon Sep 17 00:00:00 2001 From: Aparna Jyothi Date: Mon, 14 Apr 2025 16:56:54 +0530 Subject: [PATCH] error message updates --- dist/setup/index.js | 17 ++++++++--------- src/install-python.ts | 19 ++++++++----------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 9ce85b6a..ec5261ef 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -97484,10 +97484,9 @@ function getManifest() { throw new Error('The repository manifest is invalid or does not include any valid tool release (IToolRelease) entries.'); } catch (err) { - core.debug('Failed to fetch the manifest from the repository API.'); + core.debug('Fetching the manifest via the API failed.'); if (err instanceof Error) { - core.debug(`Error message: ${err.message}`); - core.debug(`Error stack: ${err.stack}`); + core.debug(err.message); } else { core.error('An unexpected error occurred while fetching the manifest.'); @@ -97498,17 +97497,17 @@ function getManifest() { } exports.getManifest = getManifest; function getManifestFromRepo() { - core.info(`Getting manifest from ${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}@${MANIFEST_REPO_BRANCH}`); + core.debug(`Getting manifest from ${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}@${MANIFEST_REPO_BRANCH}`); return tc.getManifestFromRepo(MANIFEST_REPO_OWNER, MANIFEST_REPO_NAME, AUTH, MANIFEST_REPO_BRANCH); } exports.getManifestFromRepo = getManifestFromRepo; function getManifestFromURL() { return __awaiter(this, void 0, void 0, function* () { - core.info('Falling back to fetching the manifest using raw URL.'); + core.debug('Falling back to fetching the manifest using raw URL.'); const http = new httpm.HttpClient('tool-cache'); const response = yield http.getJson(exports.MANIFEST_URL); if (!response.result) { - throw new Error(`Unable to get manifest from ${exports.MANIFEST_URL}. HTTP status: ${response.statusCode}`); + throw new Error(`Unable to get manifest from ${exports.MANIFEST_URL}`); } return response.result; }); @@ -97563,16 +97562,16 @@ function installCpythonFromRelease(release) { if (err instanceof tc.HTTPError) { // Rate limit? if (err.httpStatusCode === 403) { - core.error(`Received HTTP status code 403 (Forbidden). This usually indicates that the request is not authorized. Please check your credentials or permissions.`); + core.error(`Received HTTP status code 403. This indicates a permission issue or restricted access.`); } else if (err.httpStatusCode === 429) { - core.info(`Received HTTP status code 429 (Too Many Requests). This usually indicates that the rate limit has been exceeded. Please wait and try again later.`); + core.info(`Received HTTP status code 429. This usually indicates the rate limit has been exceeded`); } else { core.info(err.message); } if (err.stack) { - core.info(err.stack); + core.debug(err.stack); } } throw err; diff --git a/src/install-python.ts b/src/install-python.ts index 2435b8ed..bef0161c 100644 --- a/src/install-python.ts +++ b/src/install-python.ts @@ -62,10 +62,9 @@ export async function getManifest(): Promise { 'The repository manifest is invalid or does not include any valid tool release (IToolRelease) entries.' ); } catch (err) { - core.debug('Failed to fetch the manifest from the repository API.'); + core.debug('Fetching the manifest via the API failed.'); if (err instanceof Error) { - core.debug(`Error message: ${err.message}`); - core.debug(`Error stack: ${err.stack}`); + core.debug(err.message); } else { core.error('An unexpected error occurred while fetching the manifest.'); } @@ -74,7 +73,7 @@ export async function getManifest(): Promise { } export function getManifestFromRepo(): Promise { - core.info( + core.debug( `Getting manifest from ${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}@${MANIFEST_REPO_BRANCH}` ); return tc.getManifestFromRepo( @@ -86,14 +85,12 @@ export function getManifestFromRepo(): Promise { } export async function getManifestFromURL(): Promise { - core.info('Falling back to fetching the manifest using raw URL.'); + core.debug('Falling back to fetching the manifest using raw URL.'); const http: httpm.HttpClient = new httpm.HttpClient('tool-cache'); const response = await http.getJson(MANIFEST_URL); if (!response.result) { - throw new Error( - `Unable to get manifest from ${MANIFEST_URL}. HTTP status: ${response.statusCode}` - ); + throw new Error(`Unable to get manifest from ${MANIFEST_URL}`); } return response.result; } @@ -149,17 +146,17 @@ export async function installCpythonFromRelease(release: tc.IToolRelease) { // Rate limit? if (err.httpStatusCode === 403) { core.error( - `Received HTTP status code 403 (Forbidden). This usually indicates that the request is not authorized. Please check your credentials or permissions.` + `Received HTTP status code 403. This indicates a permission issue or restricted access.` ); } else if (err.httpStatusCode === 429) { core.info( - `Received HTTP status code 429 (Too Many Requests). This usually indicates that the rate limit has been exceeded. Please wait and try again later.` + `Received HTTP status code 429. This usually indicates the rate limit has been exceeded` ); } else { core.info(err.message); } if (err.stack) { - core.info(err.stack); + core.debug(err.stack); } } throw err;