Skip to content

Commit

Permalink
fix: Slack notify action that tries response.json() on application/te…
Browse files Browse the repository at this point in the history
…xt reponse
  • Loading branch information
jakob-lj committed Aug 27, 2024
1 parent 3aa9e6c commit 2655311
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions slack-notify/action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
}
}

0 comments on commit 2655311

Please sign in to comment.