From bfae9f8d516cec67d2a58e6fc15aa656d41c8cbd Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 22 Aug 2022 12:34:40 +0100 Subject: [PATCH] more debug info --- packages/builder/scripts/cypressResultsWebhook.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/builder/scripts/cypressResultsWebhook.js b/packages/builder/scripts/cypressResultsWebhook.js index 457093e013..c22c46207d 100644 --- a/packages/builder/scripts/cypressResultsWebhook.js +++ b/packages/builder/scripts/cypressResultsWebhook.js @@ -114,7 +114,7 @@ async function discordCypressResultsNotification(report) { } const response = await fetch(WEBHOOK_URL, options) - if (response.status >= 400) { + if (response.status >= 201) { const text = await response.text() console.error( `Error sending discord webhook. \nStatus: ${response.status}. \nResponse Body: ${text}. \nRequest Body: ${options.body}` @@ -123,8 +123,12 @@ async function discordCypressResultsNotification(report) { } async function run() { - const report = await generateReport() - await discordCypressResultsNotification(report) + try { + const report = await generateReport() + await discordCypressResultsNotification(report) + } catch (err) { + console.error(err) + } } run()