mirror of
https://github.com/withastro/astro.git
synced 2025-01-06 22:10:10 -05:00
fix: add property name to rss errors (#6259)
* fix: add property name to rss errors * Create good-snails-attend.md --------- Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
This commit is contained in:
parent
17869bf749
commit
dbffee4e38
2 changed files with 12 additions and 5 deletions
5
.changeset/good-snails-attend.md
Normal file
5
.changeset/good-snails-attend.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
"@astrojs/rss": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Improve RSS schema errors with additional property name context
|
|
@ -93,11 +93,13 @@ async function validateRssOptions(rssOptions: RSSOptions) {
|
||||||
return parsedResult.data;
|
return parsedResult.data;
|
||||||
}
|
}
|
||||||
const formattedError = new Error(
|
const formattedError = new Error(
|
||||||
[
|
[
|
||||||
`[RSS] Invalid or missing options:`,
|
`[RSS] Invalid or missing options:`,
|
||||||
...parsedResult.error.errors.map((zodError) => zodError.message),
|
...parsedResult.error.errors.map(
|
||||||
].join('\n')
|
zodError => `${zodError.message} (${zodError.path.join('.')})`
|
||||||
);
|
),
|
||||||
|
].join('\n')
|
||||||
|
)
|
||||||
throw formattedError;
|
throw formattedError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue