Skip to content

Commit

Permalink
Include request id in the error message of an error response
Browse files Browse the repository at this point in the history
  • Loading branch information
TooManyBees committed Mar 15, 2024
1 parent 3ff795b commit 5ab929b
Showing 1 changed file with 3 additions and 0 deletions.
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 5ab929b

Please sign in to comment.