mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -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;
|
||||
}
|
||||
const formattedError = new Error(
|
||||
[
|
||||
`[RSS] Invalid or missing options:`,
|
||||
...parsedResult.error.errors.map((zodError) => zodError.message),
|
||||
].join('\n')
|
||||
);
|
||||
[
|
||||
`[RSS] Invalid or missing options:`,
|
||||
...parsedResult.error.errors.map(
|
||||
zodError => `${zodError.message} (${zodError.path.join('.')})`
|
||||
),
|
||||
].join('\n')
|
||||
)
|
||||
throw formattedError;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue