diff --git a/dist/setup/index.js b/dist/setup/index.js index 9da44a839..be1910f0a 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -66741,16 +66741,15 @@ function installCpythonFromRelease(release) { yield installPython(pythonExtractedFolder); } catch (err) { - if (err instanceof Error) { + if (err instanceof tc.HTTPError) { // Rate limit? - if (err instanceof tc.HTTPError && - (err.httpStatusCode === 403 || err.httpStatusCode === 429)) { + if (err.httpStatusCode === 403 || err.httpStatusCode === 429) { core.info(`Received HTTP status code ${err.httpStatusCode}. This usually indicates the rate limit has been exceeded`); } else { core.info(err.message); } - if (err.stack !== undefined) { + if (err.stack) { core.debug(err.stack); } } diff --git a/src/install-python.ts b/src/install-python.ts index ec796c902..2af61291d 100644 --- a/src/install-python.ts +++ b/src/install-python.ts @@ -86,19 +86,16 @@ export async function installCpythonFromRelease(release: tc.IToolRelease) { core.info('Execute installation script'); await installPython(pythonExtractedFolder); } catch (err) { - if (err instanceof Error) { + if (err instanceof tc.HTTPError) { // Rate limit? - if ( - err instanceof tc.HTTPError && - (err.httpStatusCode === 403 || err.httpStatusCode === 429) - ) { + if (err.httpStatusCode === 403 || err.httpStatusCode === 429) { core.info( `Received HTTP status code ${err.httpStatusCode}. This usually indicates the rate limit has been exceeded` ); } else { core.info(err.message); } - if (err.stack !== undefined) { + if (err.stack) { core.debug(err.stack); } }