Update src/prompt.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Sean Goedecke
2025-08-05 11:51:50 +10:00
committed by GitHub
parent 15868b88f4
commit aaf9c5af33
+7 -1
View File
@@ -61,7 +61,13 @@ export function parseFileTemplateVariables(fileInput: string): TemplateVariables
if (!fs.existsSync(filePath)) {
throw new Error(`File for template variable '${key}' was not found: ${filePath}`)
}
result[key] = fs.readFileSync(filePath, 'utf-8')
try {
result[key] = fs.readFileSync(filePath, 'utf-8')
} catch (err) {
throw new Error(
`Failed to read file for template variable '${key}' at path '${filePath}': ${err instanceof Error ? err.message : 'Unknown error'}`
)
}
}
return result