From 5c80bcf17f70b1c277d7670833a841072e0583bd Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Wed, 15 Jun 2022 11:29:30 -0500 Subject: [PATCH] Add type annotations to all catch statements --- index.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.ts b/index.ts index e1b9b58..8a7e2bd 100644 --- a/index.ts +++ b/index.ts @@ -108,7 +108,7 @@ async function run() { let octokit = {}; try { octokit = github.getOctokit(token); - } catch (e) { + } catch (e: any) { core.setFailed( `Could not authenticate to GitHub Releases API with provided token\n${e.message}` ); @@ -122,7 +122,7 @@ async function run() { core.info( `Input version '${version}' resolved to Nextflow ${release.name}` ); - } catch (e) { + } catch (e: any) { core.setFailed( `Could not retrieve Nextflow release matching ${version}.\n${e.message}` ); @@ -133,7 +133,7 @@ async function run() { try { url = nextflow_bin_url(release, get_all); core.info(`Preparing to download from ${url}`); - } catch (e) { + } catch (e: any) { core.setFailed(`Could not parse the download URL\n${e.message}`); } try { @@ -160,14 +160,14 @@ async function run() { core.addPath(nf_path); core.info(`Downloaded \`nextflow\` to ${nf_path} and added to PATH`); - } catch (e) { + } catch (e: any) { core.setFailed(e.message); } // Run Nextflow so it downloads its dependencies try { const nf_exit_code = await exec.exec("nextflow", ["help"]) - } catch (e) { + } catch (e: any) { core.warning("Nextflow appears to have installed correctly, but an error was thrown while running it.") } }