From 35738e8b6d8d7cec68a4ee27f2e58daab4a42263 Mon Sep 17 00:00:00 2001 From: Sergey Dolin Date: Thu, 20 Oct 2022 19:34:00 +0200 Subject: [PATCH] Fix styling --- dist/setup/index.js | 7 +++---- src/install-python.ts | 9 +++------ 2 files changed, 6 insertions(+), 10 deletions(-) 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); } }