We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15868b8 commit aaf9c5aCopy full SHA for aaf9c5a
src/prompt.ts
@@ -61,7 +61,13 @@ export function parseFileTemplateVariables(fileInput: string): TemplateVariables
61
if (!fs.existsSync(filePath)) {
62
throw new Error(`File for template variable '${key}' was not found: ${filePath}`)
63
}
64
- result[key] = fs.readFileSync(filePath, 'utf-8')
+ try {
65
+ result[key] = fs.readFileSync(filePath, 'utf-8')
66
+ } catch (err) {
67
+ throw new Error(
68
+ `Failed to read file for template variable '${key}' at path '${filePath}': ${err instanceof Error ? err.message : 'Unknown error'}`
69
+ )
70
+ }
71
72
73
return result
0 commit comments