From eab71d16bdb48163d6e3d35669dee4ada4a37fa8 Mon Sep 17 00:00:00 2001 From: KeisukeYamashita <19yamashita15@gmail.com> Date: Mon, 27 Feb 2023 21:17:44 +0900 Subject: [PATCH] fix: Throw read file sync error instead of throwing static error messages (#69) --- src/run.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/run.ts b/src/run.ts index c251d8b7..183a11ce 100644 --- a/src/run.ts +++ b/src/run.ts @@ -103,15 +103,7 @@ export async function run() { console.log(`Using lcov file: ${pathToLcov}`); - let file; - - try { - file = fs.readFileSync(pathToLcov, 'utf8'); - } catch (err) { - throw new Error("Lcov file not found."); - } - - + const file = fs.readFileSync(pathToLcov, 'utf8'); const basePath = core.getInput('base-path'); const adjustedFile = basePath ? adjustLcovBasePath(file, basePath) : file;