From 265531179900979a2aec4c9aaaf5aa6609739ace Mon Sep 17 00:00:00 2001 From: Jakob Lund Johannessen Date: Tue, 27 Aug 2024 14:48:22 +0200 Subject: [PATCH] fix: Slack notify action that tries response.json() on application/text reponse --- slack-notify/action.mjs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/slack-notify/action.mjs b/slack-notify/action.mjs index 78cfca6..313f593 100644 --- a/slack-notify/action.mjs +++ b/slack-notify/action.mjs @@ -38,10 +38,7 @@ if (dryRun) { } }) if (!response.ok) { - throw new Error(`Request failed with status ${response.status} ${response.statusText}`) - } - const { ok, error } = await response.json() - if (!ok) { - throw new Error(`Request failed with error ${error}`) + const { ok, error } = await response.json() + throw new Error(`Request failed with status ${response.status} ${response.statusText}. Error: ${error}`) } }