@@ -195,6 +195,7 @@ module.exports = function run(args) {
195195 await utils . stopLocalBinary ( bsConfig , bs_local , args ) ;
196196
197197 utils . sendUsageReport ( bsConfig , args , err , Constants . messageTypes . ERROR , 'build_failed' ) ;
198+ process . exitCode = Constants . ERROR_EXIT_CODE ;
198199 } ) ;
199200 } ) . catch ( function ( err ) {
200201 // Zip Upload failed | Local Start failed
@@ -206,6 +207,7 @@ module.exports = function run(args) {
206207 fileHelpers . deleteZip ( ) ;
207208 utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . userMessages . ZIP_UPLOAD_FAILED } ` , Constants . messageTypes . ERROR , 'zip_upload_failed' ) ;
208209 }
210+ process . exitCode = Constants . ERROR_EXIT_CODE ;
209211 } ) ;
210212 } ) . catch ( function ( err ) {
211213 // Zipping failed
@@ -217,12 +219,14 @@ module.exports = function run(args) {
217219 } catch ( err ) {
218220 utils . sendUsageReport ( bsConfig , args , Constants . userMessages . ZIP_DELETE_FAILED , Constants . messageTypes . ERROR , 'zip_deletion_failed' ) ;
219221 }
222+ process . exitCode = Constants . ERROR_EXIT_CODE ;
220223 } ) ;
221224 } ) . catch ( function ( err ) {
222225 // md5 check failed
223226 logger . error ( err ) ;
224227 logger . error ( Constants . userMessages . FAILED_MD5_CHECK ) ;
225228 utils . sendUsageReport ( bsConfig , args , Constants . userMessages . MD5_CHECK_FAILED , Constants . messageTypes . ERROR , 'zip_already_uploaded_failed' ) ;
229+ process . exitCode = Constants . ERROR_EXIT_CODE ;
226230 } ) ;
227231 } ) . catch ( function ( err ) {
228232 // browerstack.json is not valid
@@ -236,11 +240,13 @@ module.exports = function run(args) {
236240
237241 let error_code = utils . getErrorCodeFromMsg ( err ) ;
238242 utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . validationMessages . NOT_VALID } ` , Constants . messageTypes . ERROR , error_code ) ;
243+ process . exitCode = Constants . ERROR_EXIT_CODE ;
239244 } ) ;
240245 } ) . catch ( function ( err ) {
241246 logger . error ( err ) ;
242247 utils . setUsageReportingFlag ( null , args . disableUsageReporting ) ;
243248 utils . sendUsageReport ( null , args , err . message , Constants . messageTypes . ERROR , utils . getErrorCodeFromErr ( err ) ) ;
249+ process . exitCode = Constants . ERROR_EXIT_CODE ;
244250 } ) . finally ( function ( ) {
245251 updateNotifier ( {
246252 pkg,
0 commit comments