@@ -189,6 +189,7 @@ module.exports = function run(args) {
189
189
await utils . stopLocalBinary ( bsConfig , bs_local , args ) ;
190
190
191
191
utils . sendUsageReport ( bsConfig , args , err , Constants . messageTypes . ERROR , 'build_failed' ) ;
192
+ process . exitCode = Constants . ERROR_EXIT_CODE ;
192
193
} ) ;
193
194
} ) . catch ( function ( err ) {
194
195
// Zip Upload failed | Local Start failed
@@ -200,6 +201,7 @@ module.exports = function run(args) {
200
201
fileHelpers . deleteZip ( ) ;
201
202
utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . userMessages . ZIP_UPLOAD_FAILED } ` , Constants . messageTypes . ERROR , 'zip_upload_failed' ) ;
202
203
}
204
+ process . exitCode = Constants . ERROR_EXIT_CODE ;
203
205
} ) ;
204
206
} ) . catch ( function ( err ) {
205
207
// Zipping failed
@@ -211,12 +213,14 @@ module.exports = function run(args) {
211
213
} catch ( err ) {
212
214
utils . sendUsageReport ( bsConfig , args , Constants . userMessages . ZIP_DELETE_FAILED , Constants . messageTypes . ERROR , 'zip_deletion_failed' ) ;
213
215
}
216
+ process . exitCode = Constants . ERROR_EXIT_CODE ;
214
217
} ) ;
215
218
} ) . catch ( function ( err ) {
216
219
// md5 check failed
217
220
logger . error ( err ) ;
218
221
logger . error ( Constants . userMessages . FAILED_MD5_CHECK ) ;
219
222
utils . sendUsageReport ( bsConfig , args , Constants . userMessages . MD5_CHECK_FAILED , Constants . messageTypes . ERROR , 'zip_already_uploaded_failed' ) ;
223
+ process . exitCode = Constants . ERROR_EXIT_CODE ;
220
224
} ) ;
221
225
} ) . catch ( function ( err ) {
222
226
// browerstack.json is not valid
@@ -230,10 +234,12 @@ module.exports = function run(args) {
230
234
231
235
let error_code = utils . getErrorCodeFromMsg ( err ) ;
232
236
utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . validationMessages . NOT_VALID } ` , Constants . messageTypes . ERROR , error_code ) ;
237
+ process . exitCode = Constants . ERROR_EXIT_CODE ;
233
238
} ) ;
234
239
} ) . catch ( function ( err ) {
235
240
logger . error ( err ) ;
236
241
utils . setUsageReportingFlag ( null , args . disableUsageReporting ) ;
237
242
utils . sendUsageReport ( null , args , err . message , Constants . messageTypes . ERROR , utils . getErrorCodeFromErr ( err ) ) ;
243
+ process . exitCode = Constants . ERROR_EXIT_CODE ;
238
244
} ) ;
239
245
}
0 commit comments