diff --git a/.changeset/good-snails-attend.md b/.changeset/good-snails-attend.md new file mode 100644 index 0000000000..7783440372 --- /dev/null +++ b/.changeset/good-snails-attend.md @@ -0,0 +1,5 @@ +--- +"@astrojs/rss": patch +--- + +Improve RSS schema errors with additional property name context diff --git a/packages/astro-rss/src/index.ts b/packages/astro-rss/src/index.ts index 800db22f06..35c14f5d57 100644 --- a/packages/astro-rss/src/index.ts +++ b/packages/astro-rss/src/index.ts @@ -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; }