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( (