Skip to content

Commit 0b3aa78

Browse files
committed
fix: throw error when include file doesn't exist
1 parent 7cf10c7 commit 0b3aa78

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/templates.mjs

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ export async function resolveTemplates (folder) {
3030

3131
const resolveIncludes = (filepath) => {
3232
let content = _cached[filepath]
33+
if (content === undefined) {
34+
const filename = filepath.replace(resolve(folder) + '/', '')
35+
throw new Error(`Template "${filename}" does not exist`)
36+
}
3337
const found = content.match(reInclude)
3438
if (found) {
3539
found.forEach(str => {

0 commit comments

Comments
 (0)