Add type annotations to all catch statements

This commit is contained in:
Thomas A. Christensen II 2022-06-15 11:29:30 -05:00
parent 8d05795dd6
commit 5c80bcf17f
Signed by: millironx
GPG key ID: 139C07724802BC5D

View file

@ -108,7 +108,7 @@ async function run() {
let octokit = {}; let octokit = {};
try { try {
octokit = github.getOctokit(token); octokit = github.getOctokit(token);
} catch (e) { } catch (e: any) {
core.setFailed( core.setFailed(
`Could not authenticate to GitHub Releases API with provided token\n${e.message}` `Could not authenticate to GitHub Releases API with provided token\n${e.message}`
); );
@ -122,7 +122,7 @@ async function run() {
core.info( core.info(
`Input version '${version}' resolved to Nextflow ${release.name}` `Input version '${version}' resolved to Nextflow ${release.name}`
); );
} catch (e) { } catch (e: any) {
core.setFailed( core.setFailed(
`Could not retrieve Nextflow release matching ${version}.\n${e.message}` `Could not retrieve Nextflow release matching ${version}.\n${e.message}`
); );
@ -133,7 +133,7 @@ async function run() {
try { try {
url = nextflow_bin_url(release, get_all); url = nextflow_bin_url(release, get_all);
core.info(`Preparing to download from ${url}`); core.info(`Preparing to download from ${url}`);
} catch (e) { } catch (e: any) {
core.setFailed(`Could not parse the download URL\n${e.message}`); core.setFailed(`Could not parse the download URL\n${e.message}`);
} }
try { try {
@ -160,14 +160,14 @@ async function run() {
core.addPath(nf_path); core.addPath(nf_path);
core.info(`Downloaded \`nextflow\` to ${nf_path} and added to PATH`); core.info(`Downloaded \`nextflow\` to ${nf_path} and added to PATH`);
} catch (e) { } catch (e: any) {
core.setFailed(e.message); core.setFailed(e.message);
} }
// Run Nextflow so it downloads its dependencies // Run Nextflow so it downloads its dependencies
try { try {
const nf_exit_code = await exec.exec("nextflow", ["help"]) 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.") core.warning("Nextflow appears to have installed correctly, but an error was thrown while running it.")
} }
} }