Skip to content

Commit

Permalink
chore(slab): display response body in case of request failure
Browse files Browse the repository at this point in the history
  • Loading branch information
soonum committed Sep 20, 2024
1 parent 447a2d0 commit 281d23a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/slab.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ async function startInstanceRequest() {
core.info(`${provider} instance start successfully requested`)
return await response.json()
} else {
const resp_body = await response.text()
core.setFailed(
`${provider} instance start request has failed (HTTP status code: ${response.status})`
`${provider} instance start request has failed (HTTP status code: ${response.status}, body: ${resp_body})`
)
}
} catch (error) {
Expand Down Expand Up @@ -124,8 +125,9 @@ async function terminateInstanceRequest(runnerName) {
core.info('Instance termination successfully requested')
return response.json()
} else {
const resp_body = await response.text()
core.setFailed(
`Instance termination request has failed (HTTP status code: ${response.status})`
`Instance termination request has failed (HTTP status code: ${response.status}, body: ${resp_body})`
)
}
} catch (error) {
Expand Down

0 comments on commit 281d23a

Please sign in to comment.