Skip to content

Commit

Permalink
Merge pull request #324 from actions/error-message-request-id
Browse files Browse the repository at this point in the history
On API error, show the request ID of the API request
  • Loading branch information
TooManyBees authored Mar 15, 2024
2 parents 3ff795b + 055f425 commit d6db901
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion coverage_badge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/internal/deployment.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ class Deployment {
// build customized error message based on server response
if (error.response) {
let errorMessage = `Failed to create deployment (status: ${error.status}) with build version ${this.buildVersion}.`
if (error.response.headers['x-github-request-id']) {
errorMessage += ` Request ID ${error.response.headers['x-github-request-id']}`
}
if (error.status === 400) {
errorMessage += ` Responded with: ${error.message}`
} else if (error.status === 403) {
Expand Down

0 comments on commit d6db901

Please sign in to comment.