From 9b637e72cb2ec0f2f49b5e5dee1c7a2b097cf6c5 Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Wed, 7 Jul 2021 16:36:36 -0700 Subject: [PATCH] catch --- dist/index.js | 4 +++- src/index.ts | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/dist/index.js b/dist/index.js index 8f80d91..b98421c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -14719,7 +14719,9 @@ try { console.log('wrote it'); console.log(fs.readdirSync(__dirname)); console.log(__dirname); - exec.exec(filename) + exec.exec(filename)["catch"](function (err) { + core.setFailed("Codecov failed with the following error: " + err.message); + }) .then(function () { console.log('finished!'); }); diff --git a/src/index.ts b/src/index.ts index 2cfb444..2340ae0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -32,6 +32,11 @@ try { console.log(__dirname); exec.exec(filename) + .catch((err) => { + core.setFailed( + `Codecov failed with the following error: ${err.message}`, + ); + }) .then(() => { console.log('finished!'); });