@@ -195,6 +195,7 @@ module.exports = function run(args) {
195
195
await utils . stopLocalBinary ( bsConfig , bs_local , args ) ;
196
196
197
197
utils . sendUsageReport ( bsConfig , args , err , Constants . messageTypes . ERROR , 'build_failed' ) ;
198
+ process . exitCode = Constants . ERROR_EXIT_CODE ;
198
199
} ) ;
199
200
} ) . catch ( function ( err ) {
200
201
// Zip Upload failed | Local Start failed
@@ -206,6 +207,7 @@ module.exports = function run(args) {
206
207
fileHelpers . deleteZip ( ) ;
207
208
utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . userMessages . ZIP_UPLOAD_FAILED } ` , Constants . messageTypes . ERROR , 'zip_upload_failed' ) ;
208
209
}
210
+ process . exitCode = Constants . ERROR_EXIT_CODE ;
209
211
} ) ;
210
212
} ) . catch ( function ( err ) {
211
213
// Zipping failed
@@ -217,12 +219,14 @@ module.exports = function run(args) {
217
219
} catch ( err ) {
218
220
utils . sendUsageReport ( bsConfig , args , Constants . userMessages . ZIP_DELETE_FAILED , Constants . messageTypes . ERROR , 'zip_deletion_failed' ) ;
219
221
}
222
+ process . exitCode = Constants . ERROR_EXIT_CODE ;
220
223
} ) ;
221
224
} ) . catch ( function ( err ) {
222
225
// md5 check failed
223
226
logger . error ( err ) ;
224
227
logger . error ( Constants . userMessages . FAILED_MD5_CHECK ) ;
225
228
utils . sendUsageReport ( bsConfig , args , Constants . userMessages . MD5_CHECK_FAILED , Constants . messageTypes . ERROR , 'zip_already_uploaded_failed' ) ;
229
+ process . exitCode = Constants . ERROR_EXIT_CODE ;
226
230
} ) ;
227
231
} ) . catch ( function ( err ) {
228
232
// browerstack.json is not valid
@@ -236,11 +240,13 @@ module.exports = function run(args) {
236
240
237
241
let error_code = utils . getErrorCodeFromMsg ( err ) ;
238
242
utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . validationMessages . NOT_VALID } ` , Constants . messageTypes . ERROR , error_code ) ;
243
+ process . exitCode = Constants . ERROR_EXIT_CODE ;
239
244
} ) ;
240
245
} ) . catch ( function ( err ) {
241
246
logger . error ( err ) ;
242
247
utils . setUsageReportingFlag ( null , args . disableUsageReporting ) ;
243
248
utils . sendUsageReport ( null , args , err . message , Constants . messageTypes . ERROR , utils . getErrorCodeFromErr ( err ) ) ;
249
+ process . exitCode = Constants . ERROR_EXIT_CODE ;
244
250
} ) . finally ( function ( ) {
245
251
updateNotifier ( {
246
252
pkg,
0 commit comments