Skip to content

Commit a2d0e83

Browse files
authored
feat: add stderr for errors when writing to excel file (#485)
Signed-off-by: Mats Johansson <extern.mats.johansson@digg.se>
1 parent d9b84d1 commit a2d0e83

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/app.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,15 @@ async function main(): Promise<void> {
191191
const diagnosticReports: DiagnosticReport[] = customDiagnostic.processDiagnosticInformation();
192192

193193
if (argv.dex != null) {
194-
const reportHandler = new ExcelReportProcessor({
195-
outputFilePath: argv.dex,
196-
});
197-
reportHandler.generateReportDocument(customDiagnostic);
194+
try {
195+
const reportHandler = new ExcelReportProcessor({
196+
outputFilePath: argv.dex,
197+
});
198+
reportHandler.generateReportDocument(customDiagnostic);
199+
} catch (dexError: any) {
200+
logErrorToFile(dexError);
201+
console.error(chalk.red('Misslyckades att skriva till excelfilen!'));
202+
}
198203
}
199204

200205
/**

0 commit comments

Comments
 (0)