Skip to content

Commit aaf9c5a

Browse files
sgoedeckeCopilot
andauthored
Update src/prompt.ts
Co-authored-by: Copilot <[email protected]>
1 parent 15868b8 commit aaf9c5a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/prompt.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,13 @@ export function parseFileTemplateVariables(fileInput: string): TemplateVariables
6161
if (!fs.existsSync(filePath)) {
6262
throw new Error(`File for template variable '${key}' was not found: ${filePath}`)
6363
}
64-
result[key] = fs.readFileSync(filePath, 'utf-8')
64+
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+
}
6571
}
6672

6773
return result

0 commit comments

Comments
 (0)