From 7f48f451dd8aba1c1a5a29ccc9870ea49f5de3b9 Mon Sep 17 00:00:00 2001 From: Naomi Date: Sun, 14 Apr 2024 09:16:15 -0700 Subject: [PATCH] fix: respond with response data if structure doesn't match (#190) This will give us a better idea of what we're actually getting back, so I can start to investigate why it doesn't match what I got back on my local instance. --- src/contexts/productBoard.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/contexts/productBoard.ts b/src/contexts/productBoard.ts index 624c59b..7edcb51 100644 --- a/src/contexts/productBoard.ts +++ b/src/contexts/productBoard.ts @@ -48,6 +48,15 @@ export const productBoard: Context = { }), }); const res = (await req.json()) as { links: { html: string } }; + if (!res.links) { + await interaction.editReply({ + content: + "Unexpected response format:\n```json\n" + + JSON.stringify(res, null, 2) + + "\n```", + }); + return; + } await interaction.editReply({ content: `[Note created](<${res.links.html}>)`, });