From 9e10e7d88ae1261fefca243cc0d2ebe3b6135e06 Mon Sep 17 00:00:00 2001 From: Alexander Alemayhu Date: Tue, 24 Dec 2024 05:57:27 +0100 Subject: [PATCH] fix: do not fail due to unoconv exit code We can get bad exit code for warnings. --- src/lib/pdf/ConvertPPTToPDF.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/pdf/ConvertPPTToPDF.ts b/src/lib/pdf/ConvertPPTToPDF.ts index 9026f90d..89bdfa2e 100644 --- a/src/lib/pdf/ConvertPPTToPDF.ts +++ b/src/lib/pdf/ConvertPPTToPDF.ts @@ -41,7 +41,10 @@ export function convertPPTToPDF( stderr ); if (error) { - reject(new Error(error.message || 'Conversion failed')); + await fs.writeFile( + path.join(workspace.location, 'error.log'), + error.message || 'Conversion failed' + ); } resolve(await fs.readFile(pdfFile)); }