fix: handle ResourceNotFoundError in generateMetadata for link surveys

This commit is contained in:
Cursor Agent
2026-03-16 14:23:59 +00:00
parent a51a006c26
commit e5cd9e5117

View File

@@ -36,7 +36,12 @@ export const generateMetadata = async (props: LinkSurveyPageProps): Promise<Meta
// Extract language code from URL params
const languageCode = typeof searchParams.lang === "string" ? searchParams.lang : undefined;
return getMetadataForLinkSurvey(params.surveyId, languageCode);
try {
return await getMetadataForLinkSurvey(params.surveyId, languageCode);
} catch (error) {
logger.error(error, "Error fetching metadata for link survey");
notFound();
}
};
export const LinkSurveyPage = async (props: LinkSurveyPageProps) => {