From 3dfea70b3f0176ec894ed9d5870adcc2dc816bfe Mon Sep 17 00:00:00 2001 From: ibrahim0814 Date: Thu, 5 Dec 2019 16:43:29 -0800 Subject: [PATCH] prettify rem extra catch block --- dist/index.js | 22 +++++++++++++++------- index.js | 22 +++++++++++++++------- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/dist/index.js b/dist/index.js index 0f5fb62..7a0189d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -331,12 +331,15 @@ try { "-Z" ], options - ).catch((err)=>{ - core.setFailed(`Codecov failed with the following error ${err}`); + ) + .catch(err => { + core.setFailed( + `Codecov failed with the following error: ${err.message}` + ); }) .then(() => { unlinkFile(); - }) + }); } else { exec .exec( @@ -353,7 +356,8 @@ try { `${yml}` ], options - ).then(() => { + ) + .then(() => { unlinkFile(); }); } @@ -373,8 +377,11 @@ try { "-Z" ], options - ).catch((err)=>{ - core.setFailed(`Codecov failed with the following error ${err}`); + ) + .catch(err => { + core.setFailed( + `Codecov failed with the following error: ${err.message}` + ); }) .then(() => { unlinkFile(); @@ -385,7 +392,8 @@ try { "bash", ["codecov.sh", "-n", `${name}`, "-F", `${flags}`, "-y", `${yml}`], options - ).then(() => { + ) + .then(() => { unlinkFile(); }); } diff --git a/index.js b/index.js index f06708e..6035a25 100644 --- a/index.js +++ b/index.js @@ -68,12 +68,15 @@ try { "-Z" ], options - ).catch((err)=>{ - core.setFailed(`Codecov failed with the following error ${err}`); + ) + .catch(err => { + core.setFailed( + `Codecov failed with the following error: ${err.message}` + ); }) .then(() => { unlinkFile(); - }) + }); } else { exec .exec( @@ -90,7 +93,8 @@ try { `${yml}` ], options - ).then(() => { + ) + .then(() => { unlinkFile(); }); } @@ -110,8 +114,11 @@ try { "-Z" ], options - ).catch((err)=>{ - core.setFailed(`Codecov failed with the following error ${err}`); + ) + .catch(err => { + core.setFailed( + `Codecov failed with the following error: ${err.message}` + ); }) .then(() => { unlinkFile(); @@ -122,7 +129,8 @@ try { "bash", ["codecov.sh", "-n", `${name}`, "-F", `${flags}`, "-y", `${yml}`], options - ).then(() => { + ) + .then(() => { unlinkFile(); }); }