From 63afba950bd2283eed6cea514747cc0ee7ae45a6 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 b0fec7c3b..2ca2fe1b6 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -66763,16 +66763,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); } }