Include request id in the error message of an error response

This commit is contained in:
Jess Bees
2024-03-15 12:59:20 -04:00
parent 3ff795bc32
commit 5ab929b077

View File

@@ -99,6 +99,9 @@ class Deployment {
// build customized error message based on server response // build customized error message based on server response
if (error.response) { if (error.response) {
let errorMessage = `Failed to create deployment (status: ${error.status}) with build version ${this.buildVersion}.` 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) { if (error.status === 400) {
errorMessage += ` Responded with: ${error.message}` errorMessage += ` Responded with: ${error.message}`
} else if (error.status === 403) { } else if (error.status === 403) {