From bb87181c5d5533c728c48e0199ef0bb36f31e626 Mon Sep 17 00:00:00 2001 From: Travis Fischer Date: Fri, 14 Oct 2022 23:47:38 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/api/social-image.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pages/api/social-image.tsx b/pages/api/social-image.tsx index 610270f..f6fe068 100644 --- a/pages/api/social-image.tsx +++ b/pages/api/social-image.tsx @@ -34,7 +34,11 @@ export default async function OGImage(req: NextRequest) { body: JSON.stringify({ pageId }), headers: { 'Content-Type': 'application/json' } }) + if (!pageInfoRes.ok) { + return new Response(pageInfoRes.statusText, { status: pageInfoRes.status }) + } const pageInfo: NotionPageInfo = await pageInfoRes.json() + console.log(pageInfo) return new ImageResponse( (