diff --git a/packages/astro-rss/src/index.ts b/packages/astro-rss/src/index.ts index 738e696f39b6..c8cf19d6022e 100644 --- a/packages/astro-rss/src/index.ts +++ b/packages/astro-rss/src/index.ts @@ -109,22 +109,21 @@ async function validateRssOptions(rssOptions: RSSOptions) { const formattedError = new Error( [ `[RSS] Invalid or missing options:`, - ...parsedResult.error.errors.map( - (zodError) => { - const path = zodError.path.join('.'); - const message = `${zodError.message} (${path})`; - const code = zodError.code; + ...parsedResult.error.errors.map((zodError) => { + const path = zodError.path.join('.'); + const message = `${zodError.message} (${path})`; + const code = zodError.code; - if (path === 'items' && code === 'invalid_union') { - return [ - message, + if (path === 'items' && code === 'invalid_union') { + return [ + message, `The \`items\` property requires properly typed \`title\`, \`pubDate\`, and \`link\` keys.`, - `Check your collection's schema, and visit https://docs.astro.build/en/guides/rss/#generating-items for more info.` - ].join('\n') - } + `Check your collection's schema, and visit https://docs.astro.build/en/guides/rss/#generating-items for more info.`, + ].join('\n'); + } - return message; - }), + return message; + }), ].join('\n') ); throw formattedError;