diff --git a/core/lib/server/pub.ts b/core/lib/server/pub.ts index 733fa5024..468dba9b7 100644 --- a/core/lib/server/pub.ts +++ b/core/lib/server/pub.ts @@ -2246,5 +2246,5 @@ export const getExclusivelyRelatedPub = async (relatedPubId: PubsId, relationFie ).as("values"), pubType({ eb, pubTypeIdRef: "pubs.pubTypeId" }), ]) - ).executeTakeFirstOrThrow(); + ).executeTakeFirst(); }; diff --git a/core/lib/server/render/pub/renderMarkdownWithPub.ts b/core/lib/server/render/pub/renderMarkdownWithPub.ts index 3f4c34b30..f7d04bebe 100644 --- a/core/lib/server/render/pub/renderMarkdownWithPub.ts +++ b/core/lib/server/render/pub/renderMarkdownWithPub.ts @@ -343,9 +343,9 @@ const renderMarkdownWithPubPlugin: Plugin<[utils.RenderWithPubContext]> = (conte const directiveName = node.name.toLowerCase() as RenderWithPubToken; const directiveVisitor = directiveVisitors[directiveName]; const { rel, ...attrs } = expect(node.attributes); - const relatedPub = await getExclusivelyRelatedPub( - context.pub.id as PubsId, - rel + const relatedPub = expect( + await getExclusivelyRelatedPub(context.pub.id as PubsId, rel), + `The email template included a directive containing rel="${rel}", but the pub is not related to any other pubs through this field.` ); node.attributes = attrs; directiveVisitor(node, {