Verbessere Fehlerbehandlung beim Laden von PDF-Vorlagen und füge Ursacheninformationen hinzu
Some checks failed
Code Analysis and Production Deploy / deploy-production (push) Has been cancelled
Code Analysis and Production Deploy / deploy-test (push) Has been cancelled
Code Analysis and Production Deploy / analyze (push) Has been cancelled

This commit is contained in:
Torsten Schulz (local)
2026-07-17 08:50:47 +02:00
parent bd45beadd5
commit f0ac4b7e56
6 changed files with 96 additions and 67 deletions

View File

@@ -371,7 +371,10 @@ export default defineEventHandler(async (event) => {
arrayBuffer = await res.arrayBuffer()
}
} catch (templateLoadError) {
throw new Error('Template-Laden fehlgeschlagen: ' + templateLoadError.message)
throw new Error(
'Template-Laden fehlgeschlagen: ' + (templateLoadError?.message || String(templateLoadError)),
{ cause: templateLoadError }
)
}
const pdfDoc = await PDFDocument.load(arrayBuffer)