@@ -162,6 +162,7 @@ const sendUpdatesToBstack = async (bsConfig, buildId, args, options, rawArgs) =>
162
162
request . post ( options , function ( err , resp , data ) {
163
163
if ( err ) {
164
164
utils . sendUsageReport ( bsConfig , args , err , Constants . messageTypes . ERROR , 'api_failed_build_artifacts_status_update' , null , rawArgs ) ;
165
+ logger . error ( utils . formatRequest ( err , resp , body ) ) ;
165
166
reject ( err ) ;
166
167
} else {
167
168
try {
@@ -203,6 +204,7 @@ exports.downloadBuildArtifacts = async (bsConfig, buildId, args, rawArgs) => {
203
204
let buildDetails = null ;
204
205
request . get ( options , async function ( err , resp , body ) {
205
206
if ( err ) {
207
+ logger . error ( utils . formatRequest ( err , resp , body ) ) ;
206
208
utils . sendUsageReport ( bsConfig , args , err , Constants . messageTypes . ERROR , 'api_failed_build_artifacts' , null , rawArgs ) ;
207
209
process . exitCode = Constants . ERROR_EXIT_CODE ;
208
210
} else {
@@ -211,6 +213,7 @@ exports.downloadBuildArtifacts = async (bsConfig, buildId, args, rawArgs) => {
211
213
if ( resp . statusCode != 200 ) {
212
214
logger . error ( 'Downloading the build artifacts failed.' ) ;
213
215
logger . error ( `Error: Request failed with status code ${ resp . statusCode } ` )
216
+ logger . error ( utils . formatRequest ( err , resp , body ) ) ;
214
217
utils . sendUsageReport ( bsConfig , args , buildDetails , Constants . messageTypes . ERROR , 'api_failed_build_artifacts' , null , rawArgs ) ;
215
218
process . exitCode = Constants . ERROR_EXIT_CODE ;
216
219
} else {
@@ -241,6 +244,7 @@ exports.downloadBuildArtifacts = async (bsConfig, buildId, args, rawArgs) => {
241
244
}
242
245
utils . sendUsageReport ( bsConfig , args , err , messageType , errorCode , null , rawArgs ) ;
243
246
logger . error ( `Error: Request failed with status code ${ resp . statusCode } ` )
247
+ logger . error ( utils . formatRequest ( err , resp , body ) ) ;
244
248
process . exitCode = Constants . ERROR_EXIT_CODE ;
245
249
}
246
250
}
0 commit comments