From 5f55456d463175ff2ddc3b652a2a74627629d211 Mon Sep 17 00:00:00 2001 From: ibrahim0814 Date: Thu, 5 Dec 2019 19:44:49 -0800 Subject: [PATCH] remove catch block --- dist/index.js | 12 ++++++------ index.js | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dist/index.js b/dist/index.js index 07d281f..4ad6449 100644 --- a/dist/index.js +++ b/dist/index.js @@ -288,6 +288,12 @@ try { } request("https://codecov.io/bas", (error, response, body) => { + if (error && fail_ci) { + throw error; + } else if (error) { + core.warning(error); + } + fs.writeFile("codecov.sh", body, err => { if (err && fail_ci) { throw err; @@ -411,12 +417,6 @@ try { }); }; }); - }).catch(err => { - if (fail_ci) { - core.setFailed(err.message); - } else { - core.warning(err.message); - } }); } catch (error) { if (fail_ci) { diff --git a/index.js b/index.js index 84f1a83..b034f49 100644 --- a/index.js +++ b/index.js @@ -25,6 +25,12 @@ try { } request("https://codecov.io/bas", (error, response, body) => { + if (error && fail_ci) { + throw error; + } else if (error) { + core.warning(error); + } + fs.writeFile("codecov.sh", body, err => { if (err && fail_ci) { throw err; @@ -148,12 +154,6 @@ try { }); }; }); - }).catch(err => { - if (fail_ci) { - core.setFailed(err.message); - } else { - core.warning(err.message); - } }); } catch (error) { if (fail_ci) {