Skip to content

Commit 12f5b5f

Browse files
EinarSnorrasonthc202
authored andcommitted
chore: Include error messages when logging
Also use error instead of log. Signed-off-by: EinarSnorrason <[email protected]>
1 parent e3500e9 commit 12f5b5f

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

src/action-helper.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ const actionHelper = {
4949
}
5050
}
5151
} catch (err) {
52-
console.log(`Error when reading the rules file: ${tsvFile}`);
52+
console.error(
53+
`Error when reading the rules file: ${tsvFile} err: ${(
54+
err as Error
55+
).toString()}`,
56+
);
5357
}
5458

5559
return plugins;
@@ -203,7 +207,11 @@ const actionHelper = {
203207
try {
204208
res = fs.readFileSync(reportName, { encoding: "base64" });
205209
} catch (err) {
206-
console.log("error while reading the markdown file!");
210+
console.error(
211+
`Error occurred while reading the markdown file! err: ${(
212+
err as Error
213+
).toString()}`,
214+
);
207215
}
208216
return res;
209217
},
@@ -290,8 +298,12 @@ const actionHelper = {
290298
}
291299
});
292300
}
293-
} catch (e) {
294-
console.log(`Error occurred while downloading the artifacts!`);
301+
} catch (err) {
302+
console.error(
303+
`Error occurred while downloading the artifacts! err: ${(
304+
err as Error
305+
).toString()}`,
306+
);
295307
}
296308
return previousReport;
297309
},

0 commit comments

Comments
 (0)