error message updates

This commit is contained in:
Aparna Jyothi 2025-04-14 16:56:54 +05:30
parent cc6c47bafb
commit 1032141ebd
2 changed files with 16 additions and 20 deletions

17
dist/setup/index.js vendored
View File

@ -97484,10 +97484,9 @@ function getManifest() {
throw new Error('The repository manifest is invalid or does not include any valid tool release (IToolRelease) entries.'); throw new Error('The repository manifest is invalid or does not include any valid tool release (IToolRelease) entries.');
} }
catch (err) { 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) { if (err instanceof Error) {
core.debug(`Error message: ${err.message}`); core.debug(err.message);
core.debug(`Error stack: ${err.stack}`);
} }
else { else {
core.error('An unexpected error occurred while fetching the manifest.'); core.error('An unexpected error occurred while fetching the manifest.');
@ -97498,17 +97497,17 @@ function getManifest() {
} }
exports.getManifest = getManifest; exports.getManifest = getManifest;
function getManifestFromRepo() { 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); return tc.getManifestFromRepo(MANIFEST_REPO_OWNER, MANIFEST_REPO_NAME, AUTH, MANIFEST_REPO_BRANCH);
} }
exports.getManifestFromRepo = getManifestFromRepo; exports.getManifestFromRepo = getManifestFromRepo;
function getManifestFromURL() { function getManifestFromURL() {
return __awaiter(this, void 0, void 0, function* () { 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 http = new httpm.HttpClient('tool-cache');
const response = yield http.getJson(exports.MANIFEST_URL); const response = yield http.getJson(exports.MANIFEST_URL);
if (!response.result) { 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; return response.result;
}); });
@ -97563,16 +97562,16 @@ function installCpythonFromRelease(release) {
if (err instanceof tc.HTTPError) { if (err instanceof tc.HTTPError) {
// Rate limit? // Rate limit?
if (err.httpStatusCode === 403) { 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) { 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 { else {
core.info(err.message); core.info(err.message);
} }
if (err.stack) { if (err.stack) {
core.info(err.stack); core.debug(err.stack);
} }
} }
throw err; throw err;

View File

@ -62,10 +62,9 @@ export async function getManifest(): Promise<tc.IToolRelease[]> {
'The repository manifest is invalid or does not include any valid tool release (IToolRelease) entries.' 'The repository manifest is invalid or does not include any valid tool release (IToolRelease) entries.'
); );
} catch (err) { } 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) { if (err instanceof Error) {
core.debug(`Error message: ${err.message}`); core.debug(err.message);
core.debug(`Error stack: ${err.stack}`);
} else { } else {
core.error('An unexpected error occurred while fetching the manifest.'); core.error('An unexpected error occurred while fetching the manifest.');
} }
@ -74,7 +73,7 @@ export async function getManifest(): Promise<tc.IToolRelease[]> {
} }
export function getManifestFromRepo(): Promise<tc.IToolRelease[]> { export function getManifestFromRepo(): Promise<tc.IToolRelease[]> {
core.info( core.debug(
`Getting manifest from ${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}@${MANIFEST_REPO_BRANCH}` `Getting manifest from ${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}@${MANIFEST_REPO_BRANCH}`
); );
return tc.getManifestFromRepo( return tc.getManifestFromRepo(
@ -86,14 +85,12 @@ export function getManifestFromRepo(): Promise<tc.IToolRelease[]> {
} }
export async function getManifestFromURL(): Promise<tc.IToolRelease[]> { export async function getManifestFromURL(): Promise<tc.IToolRelease[]> {
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 http: httpm.HttpClient = new httpm.HttpClient('tool-cache');
const response = await http.getJson<tc.IToolRelease[]>(MANIFEST_URL); const response = await http.getJson<tc.IToolRelease[]>(MANIFEST_URL);
if (!response.result) { if (!response.result) {
throw new Error( throw new Error(`Unable to get manifest from ${MANIFEST_URL}`);
`Unable to get manifest from ${MANIFEST_URL}. HTTP status: ${response.statusCode}`
);
} }
return response.result; return response.result;
} }
@ -149,17 +146,17 @@ export async function installCpythonFromRelease(release: tc.IToolRelease) {
// Rate limit? // Rate limit?
if (err.httpStatusCode === 403) { if (err.httpStatusCode === 403) {
core.error( 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) { } else if (err.httpStatusCode === 429) {
core.info( 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 { } else {
core.info(err.message); core.info(err.message);
} }
if (err.stack) { if (err.stack) {
core.info(err.stack); core.debug(err.stack);
} }
} }
throw err; throw err;