update error to debug

This commit is contained in:
Aparna Jyothi 2025-04-14 13:12:15 +05:30
parent 93e3e02877
commit 7faf95d67a
2 changed files with 16 additions and 25 deletions

17
dist/setup/index.js vendored
View File

@ -97561,21 +97561,18 @@ function installCpythonFromRelease(release) {
} }
catch (err) { catch (err) {
if (err instanceof tc.HTTPError) { if (err instanceof tc.HTTPError) {
const statusCode = err.httpStatusCode; // Rate limit?
if (statusCode === 429) { if (err.httpStatusCode === 403) {
// Too Many Requests - usually temporary and can be retried core.error(`Received HTTP status code 403 (Forbidden). This usually indicates that the request is not authorized. Please check your credentials or permissions.`);
core.info(`Received HTTP status code ${statusCode}. This usually indicates the rate limit has been exceeded. Consider retrying after some time.`);
} }
else if (statusCode === 403) { else if (err.httpStatusCode === 429) {
// Forbidden - likely a permanent issue 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.error(`Received HTTP status code ${statusCode}. Access is forbidden. Please check your credentials or permissions.`);
} }
else { else {
// Other HTTP errors core.info(err.message);
core.info(`Received HTTP error ${statusCode}: ${err.message}`);
} }
if (err.stack) { if (err.stack) {
core.debug(`Stack trace: ${err.stack}`); core.debug(err.stack);
} }
} }
throw err; throw err;

View File

@ -146,28 +146,22 @@ export async function installCpythonFromRelease(release: tc.IToolRelease) {
await installPython(pythonExtractedFolder); await installPython(pythonExtractedFolder);
} catch (err) { } catch (err) {
if (err instanceof tc.HTTPError) { if (err instanceof tc.HTTPError) {
const statusCode = err.httpStatusCode; // Rate limit?
if (err.httpStatusCode === 403) {
if (statusCode === 429) {
// Too Many Requests - usually temporary and can be retried
core.info(
`Received HTTP status code ${statusCode}. This usually indicates the rate limit has been exceeded. Consider retrying after some time.`
);
} else if (statusCode === 403) {
// Forbidden - likely a permanent issue
core.error( core.error(
`Received HTTP status code ${statusCode}. Access is forbidden. Please check your credentials or permissions.` `Received HTTP status code 403 (Forbidden). This usually indicates that the request is not authorized. Please check your credentials or permissions.`
);
} 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.`
); );
} else { } else {
// Other HTTP errors core.info(err.message);
core.info(`Received HTTP error ${statusCode}: ${err.message}`);
} }
if (err.stack) { if (err.stack) {
core.debug(`Stack trace: ${err.stack}`); core.debug(err.stack);
} }
} }
throw err; throw err;
} }
} }