mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
fix: catch image errors correctly (#12695)
This commit is contained in:
parent
2b53588772
commit
a203d5dd58
2 changed files with 6 additions and 1 deletions
5
.changeset/nine-experts-tan.md
Normal file
5
.changeset/nine-experts-tan.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'astro': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Throws a more helpful error when images are missing
|
|
@ -39,7 +39,7 @@ export function astroContentAssetPropagationPlugin({
|
||||||
? fileURLToPath(new URL(importerParam, settings.config.root))
|
? fileURLToPath(new URL(importerParam, settings.config.root))
|
||||||
: importer;
|
: importer;
|
||||||
|
|
||||||
const resolved = this.resolve(base, importerPath, { skipSelf: true, ...opts });
|
const resolved = await this.resolve(base, importerPath, { skipSelf: true, ...opts });
|
||||||
if (!resolved) {
|
if (!resolved) {
|
||||||
throw new AstroError({
|
throw new AstroError({
|
||||||
...AstroErrorData.ImageNotFound,
|
...AstroErrorData.ImageNotFound,
|
||||||
|
|
Loading…
Reference in a new issue