more debug info

This commit is contained in:
Martin McKeaveney 2022-08-22 12:34:40 +01:00
parent 3f661d06a9
commit f95ea519a4
1 changed files with 7 additions and 3 deletions

View File

@ -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() {
try {
const report = await generateReport()
await discordCypressResultsNotification(report)
} catch (err) {
console.error(err)
}
}
run()