feat: more readable error message for image not found
This commit is contained in:
parent
085fd62a79
commit
8beeba81db
|
@ -32,10 +32,11 @@ if (isLocal) {
|
||||||
let normalizedPath = path
|
let normalizedPath = path
|
||||||
.normalize(path.join('../../', basePath, src))
|
.normalize(path.join('../../', basePath, src))
|
||||||
.replace(/\\/g, '/')
|
.replace(/\\/g, '/')
|
||||||
img = await files[normalizedPath]()
|
const file = files[normalizedPath]
|
||||||
if (!img) {
|
if (!file) {
|
||||||
console.error(`No image found for path ${normalizedPath}`)
|
console.error(`\n[ERROR] Image file not found: ${normalizedPath.replace('../../', 'src/')}`)
|
||||||
}
|
}
|
||||||
|
img = await file()
|
||||||
}
|
}
|
||||||
|
|
||||||
const imageClass = 'w-full h-full object-cover'
|
const imageClass = 'w-full h-full object-cover'
|
||||||
|
|
Loading…
Reference in New Issue