diff --git a/automl/snippets/batch_predict.js b/automl/snippets/batch_predict.js index be959c236a8..e39c2299bac 100644 --- a/automl/snippets/batch_predict.js +++ b/automl/snippets/batch_predict.js @@ -67,4 +67,8 @@ function main( // [END automl_batch_predict] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/beta/batch_predict.js b/automl/snippets/beta/batch_predict.js index af95de6c820..832ee7c63d8 100644 --- a/automl/snippets/beta/batch_predict.js +++ b/automl/snippets/beta/batch_predict.js @@ -67,4 +67,8 @@ function main( // [END automl_batch_predict_beta] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/beta/delete-dataset.js b/automl/snippets/beta/delete-dataset.js index 4044d61dfb4..4aae984f38d 100644 --- a/automl/snippets/beta/delete-dataset.js +++ b/automl/snippets/beta/delete-dataset.js @@ -50,4 +50,8 @@ function main( // [END automl_delete_dataset_beta] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/beta/delete-model.js b/automl/snippets/beta/delete-model.js index e409a7b9b2e..0a3d61c420d 100644 --- a/automl/snippets/beta/delete-model.js +++ b/automl/snippets/beta/delete-model.js @@ -47,4 +47,8 @@ function main( // [END automl_delete_model_beta] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/beta/get-model-evaluation.js b/automl/snippets/beta/get-model-evaluation.js index 1081cbab019..8ab4dac4c5f 100644 --- a/automl/snippets/beta/get-model-evaluation.js +++ b/automl/snippets/beta/get-model-evaluation.js @@ -57,6 +57,7 @@ function main( console.log(`\tnanos ${response.createTime.nanos / 1e9}`); console.log(`Evaluation example count: ${response.evaluatedExampleCount}`); // [END automl_video_object_tracking_get_model_evaluation_beta] + // [END automl_video_classification_get_model_evaluation_beta] // [START automl_video_classification_get_model_evaluation_beta] console.log( @@ -77,4 +78,8 @@ function main( // [END automl_video_object_tracking_get_model_evaluation_beta] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/beta/get-model.js b/automl/snippets/beta/get-model.js index d78cc930d1c..16583398dae 100644 --- a/automl/snippets/beta/get-model.js +++ b/automl/snippets/beta/get-model.js @@ -58,4 +58,8 @@ function main( // [END automl_get_model_beta] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/beta/get-operation-status.js b/automl/snippets/beta/get-operation-status.js index 1d47396aeb2..d11ec2506c8 100644 --- a/automl/snippets/beta/get-operation-status.js +++ b/automl/snippets/beta/get-operation-status.js @@ -50,4 +50,8 @@ function main( // [END automl_get_operation_status_beta] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/beta/import-dataset.js b/automl/snippets/beta/import-dataset.js index 54f41ea0829..37d76512148 100644 --- a/automl/snippets/beta/import-dataset.js +++ b/automl/snippets/beta/import-dataset.js @@ -59,4 +59,8 @@ function main( // [END automl_import_dataset_beta] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/beta/list-datasets.js b/automl/snippets/beta/list-datasets.js index 2c0c5758d45..4668638102e 100644 --- a/automl/snippets/beta/list-datasets.js +++ b/automl/snippets/beta/list-datasets.js @@ -70,4 +70,8 @@ function main(projectId = 'YOUR_PROJECT_ID', location = 'us-central1') { // [END automl_video_object_tracking_list_datasets_beta] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/beta/list-models.js b/automl/snippets/beta/list-models.js index 2f3ff570f3c..9f392acdfa1 100644 --- a/automl/snippets/beta/list-models.js +++ b/automl/snippets/beta/list-models.js @@ -54,4 +54,8 @@ function main(projectId = 'YOUR_PROJECT_ID', location = 'us-central1') { // [END automl_list_models_beta] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/beta/video-classification-create-dataset.js b/automl/snippets/beta/video-classification-create-dataset.js index 55a5c1b670b..d345c8209c1 100644 --- a/automl/snippets/beta/video-classification-create-dataset.js +++ b/automl/snippets/beta/video-classification-create-dataset.js @@ -59,4 +59,8 @@ function main( // [END automl_video_classification_create_dataset_beta] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/beta/video-classification-create-model.js b/automl/snippets/beta/video-classification-create-model.js index 71e378fb463..ca7c1eb04ca 100644 --- a/automl/snippets/beta/video-classification-create-model.js +++ b/automl/snippets/beta/video-classification-create-model.js @@ -56,4 +56,8 @@ function main( // [END automl_video_classification_create_model_beta] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/beta/video-object-tracking-create-dataset.js b/automl/snippets/beta/video-object-tracking-create-dataset.js index 9ecf0f375ab..561e65fe77e 100644 --- a/automl/snippets/beta/video-object-tracking-create-dataset.js +++ b/automl/snippets/beta/video-object-tracking-create-dataset.js @@ -59,4 +59,8 @@ function main( // [END automl_video_object_tracking_create_dataset_beta] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/beta/video-object-tracking-create-model.js b/automl/snippets/beta/video-object-tracking-create-model.js index 2131034bb1d..7a93864d737 100644 --- a/automl/snippets/beta/video-object-tracking-create-model.js +++ b/automl/snippets/beta/video-object-tracking-create-model.js @@ -56,4 +56,8 @@ function main( // [END automl_video_object_tracking_create_model_beta] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/delete_dataset.js b/automl/snippets/delete_dataset.js index 98d55cb7eca..ef882e524aa 100644 --- a/automl/snippets/delete_dataset.js +++ b/automl/snippets/delete_dataset.js @@ -50,4 +50,8 @@ function main( // [END automl_delete_dataset] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/delete_model.js b/automl/snippets/delete_model.js index a5e921275cc..686d6621902 100644 --- a/automl/snippets/delete_model.js +++ b/automl/snippets/delete_model.js @@ -47,4 +47,8 @@ function main( // [END automl_delete_model] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/deploy_model.js b/automl/snippets/deploy_model.js index 3f3b3c53fbe..b51c43f5f5d 100644 --- a/automl/snippets/deploy_model.js +++ b/automl/snippets/deploy_model.js @@ -50,4 +50,8 @@ function main( // [END automl_deploy_model] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/export_dataset.js b/automl/snippets/export_dataset.js index cc89fd586e8..89f8710d28a 100644 --- a/automl/snippets/export_dataset.js +++ b/automl/snippets/export_dataset.js @@ -56,4 +56,8 @@ function main( // [END automl_export_dataset] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/get_dataset.js b/automl/snippets/get_dataset.js index e5be41ee4f4..8cee2686308 100644 --- a/automl/snippets/get_dataset.js +++ b/automl/snippets/get_dataset.js @@ -94,4 +94,8 @@ function main( // [END automl_vision_object_detection_get_dataset] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/get_model.js b/automl/snippets/get_model.js index 477f627aa3b..1ebc265c096 100644 --- a/automl/snippets/get_model.js +++ b/automl/snippets/get_model.js @@ -58,4 +58,8 @@ function main( // [END automl_get_model] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/get_model_evaluation.js b/automl/snippets/get_model_evaluation.js index aefb03bf442..724c6cf224c 100644 --- a/automl/snippets/get_model_evaluation.js +++ b/automl/snippets/get_model_evaluation.js @@ -110,4 +110,8 @@ function main( // [END automl_vision_object_detection_get_model_evaluation] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/get_operation_status.js b/automl/snippets/get_operation_status.js index bd6f3c55380..a503550e90e 100644 --- a/automl/snippets/get_operation_status.js +++ b/automl/snippets/get_operation_status.js @@ -50,4 +50,8 @@ function main( // [END automl_get_operation_status] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/import_dataset.js b/automl/snippets/import_dataset.js index fe4bdb14f78..72815f68b7f 100644 --- a/automl/snippets/import_dataset.js +++ b/automl/snippets/import_dataset.js @@ -59,4 +59,8 @@ function main( // [END automl_import_dataset] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/language_entity_extraction_create_dataset.js b/automl/snippets/language_entity_extraction_create_dataset.js index b5fd37658ec..ba31bee259a 100644 --- a/automl/snippets/language_entity_extraction_create_dataset.js +++ b/automl/snippets/language_entity_extraction_create_dataset.js @@ -62,4 +62,8 @@ function main( // [END automl_language_entity_extraction_create_dataset] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/language_entity_extraction_create_model.js b/automl/snippets/language_entity_extraction_create_model.js index 0f6c5bd5c0e..53b4dea68de 100644 --- a/automl/snippets/language_entity_extraction_create_model.js +++ b/automl/snippets/language_entity_extraction_create_model.js @@ -56,4 +56,8 @@ function main( // [END automl_language_entity_extraction_create_model] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/language_entity_extraction_predict.js b/automl/snippets/language_entity_extraction_predict.js index f5c6c7d4f91..f98b8a2010b 100644 --- a/automl/snippets/language_entity_extraction_predict.js +++ b/automl/snippets/language_entity_extraction_predict.js @@ -65,4 +65,8 @@ function main( // [END automl_language_entity_extraction_predict] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/language_sentiment_analysis_create_dataset.js b/automl/snippets/language_sentiment_analysis_create_dataset.js index d146d4e12ea..8f406b5c711 100644 --- a/automl/snippets/language_sentiment_analysis_create_dataset.js +++ b/automl/snippets/language_sentiment_analysis_create_dataset.js @@ -64,4 +64,8 @@ function main( // [END automl_language_sentiment_analysis_create_dataset] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/language_sentiment_analysis_create_model.js b/automl/snippets/language_sentiment_analysis_create_model.js index dff8107d3b5..76f559ab0c8 100644 --- a/automl/snippets/language_sentiment_analysis_create_model.js +++ b/automl/snippets/language_sentiment_analysis_create_model.js @@ -56,4 +56,8 @@ function main( // [END automl_language_sentiment_analysis_create_model] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/language_sentiment_analysis_predict.js b/automl/snippets/language_sentiment_analysis_predict.js index a20b761653d..44d8a20959b 100644 --- a/automl/snippets/language_sentiment_analysis_predict.js +++ b/automl/snippets/language_sentiment_analysis_predict.js @@ -61,4 +61,8 @@ function main( // [END automl_language_sentiment_analysis_predict] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/language_text_classification_create_dataset.js b/automl/snippets/language_text_classification_create_dataset.js index bd68f1a9558..afe3ffdb745 100644 --- a/automl/snippets/language_text_classification_create_dataset.js +++ b/automl/snippets/language_text_classification_create_dataset.js @@ -64,4 +64,8 @@ function main( // [END automl_language_text_classification_create_dataset] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/language_text_classification_create_model.js b/automl/snippets/language_text_classification_create_model.js index 2a80814367e..8292e2ebaa3 100644 --- a/automl/snippets/language_text_classification_create_model.js +++ b/automl/snippets/language_text_classification_create_model.js @@ -56,4 +56,8 @@ function main( // [END automl_language_text_classification_create_model] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/language_text_classification_predict.js b/automl/snippets/language_text_classification_predict.js index ab680e9781e..1e7b77b8764 100644 --- a/automl/snippets/language_text_classification_predict.js +++ b/automl/snippets/language_text_classification_predict.js @@ -61,4 +61,8 @@ function main( // [END automl_language_text_classification_predict] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/list_datasets.js b/automl/snippets/list_datasets.js index be9bbdf4403..555d8230931 100644 --- a/automl/snippets/list_datasets.js +++ b/automl/snippets/list_datasets.js @@ -105,4 +105,8 @@ function main(projectId = 'YOUR_PROJECT_ID', location = 'us-central1') { // [END automl_vision_object_detection_list_datasets] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/list_model_evaluations.js b/automl/snippets/list_model_evaluations.js index ca9d248b08d..d8cd6bb070a 100644 --- a/automl/snippets/list_model_evaluations.js +++ b/automl/snippets/list_model_evaluations.js @@ -109,4 +109,8 @@ function main( // [END automl_vision_object_detection_list_model_evaluations] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/list_models.js b/automl/snippets/list_models.js index 0fe0ac219e1..1a6a4600ea5 100644 --- a/automl/snippets/list_models.js +++ b/automl/snippets/list_models.js @@ -54,4 +54,8 @@ function main(projectId = 'YOUR_PROJECT_ID', location = 'us-central1') { // [END automl_list_models] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/list_operation_status.js b/automl/snippets/list_operation_status.js index 49c98effd01..9d1630d2a68 100644 --- a/automl/snippets/list_operation_status.js +++ b/automl/snippets/list_operation_status.js @@ -49,4 +49,8 @@ function main(projectId = 'YOUR_PROJECT_ID', location = 'us-central1') { // [END automl_list_operation_status] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/translate_create_dataset.js b/automl/snippets/translate_create_dataset.js index 53695ad89e3..b4be3e624d9 100644 --- a/automl/snippets/translate_create_dataset.js +++ b/automl/snippets/translate_create_dataset.js @@ -65,4 +65,8 @@ function main( // [END automl_translate_create_dataset] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/translate_create_model.js b/automl/snippets/translate_create_model.js index 550df01aea9..a4bf34546ec 100644 --- a/automl/snippets/translate_create_model.js +++ b/automl/snippets/translate_create_model.js @@ -56,4 +56,8 @@ function main( // [END automl_translate_create_model] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/translate_predict.js b/automl/snippets/translate_predict.js index 7e69d2c4c30..cbdcfb127ba 100644 --- a/automl/snippets/translate_predict.js +++ b/automl/snippets/translate_predict.js @@ -62,4 +62,8 @@ function main( // [END automl_translate_predict] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/undeploy_model.js b/automl/snippets/undeploy_model.js index 1ac93035c90..35ac9781898 100644 --- a/automl/snippets/undeploy_model.js +++ b/automl/snippets/undeploy_model.js @@ -50,4 +50,8 @@ function main( // [END automl_undeploy_model] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/vision_classification_create_dataset.js b/automl/snippets/vision_classification_create_dataset.js index ed63a2800e8..b2e8184bbb3 100644 --- a/automl/snippets/vision_classification_create_dataset.js +++ b/automl/snippets/vision_classification_create_dataset.js @@ -68,4 +68,8 @@ function main( // [END automl_vision_classification_create_dataset] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/vision_classification_create_model.js b/automl/snippets/vision_classification_create_model.js index 1c2e3558a91..fefa29648c4 100644 --- a/automl/snippets/vision_classification_create_model.js +++ b/automl/snippets/vision_classification_create_model.js @@ -58,4 +58,8 @@ function main( // [END automl_vision_classification_create_model] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/vision_classification_deploy_model_node_count.js b/automl/snippets/vision_classification_deploy_model_node_count.js index d9844d2ccee..80971ba1e69 100644 --- a/automl/snippets/vision_classification_deploy_model_node_count.js +++ b/automl/snippets/vision_classification_deploy_model_node_count.js @@ -53,4 +53,8 @@ function main( // [END automl_vision_classification_deploy_model_node_count] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/vision_classification_predict.js b/automl/snippets/vision_classification_predict.js index 9e34c0822f7..a46fac2591d 100644 --- a/automl/snippets/vision_classification_predict.js +++ b/automl/snippets/vision_classification_predict.js @@ -66,4 +66,8 @@ function main( // [END automl_vision_classification_predict] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/vision_object_detection_create_dataset.js b/automl/snippets/vision_object_detection_create_dataset.js index 88fefca1232..bfa74cff138 100644 --- a/automl/snippets/vision_object_detection_create_dataset.js +++ b/automl/snippets/vision_object_detection_create_dataset.js @@ -62,4 +62,8 @@ function main( // [END automl_vision_object_detection_create_dataset] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/vision_object_detection_create_model.js b/automl/snippets/vision_object_detection_create_model.js index 1530483979a..ef8922c177b 100644 --- a/automl/snippets/vision_object_detection_create_model.js +++ b/automl/snippets/vision_object_detection_create_model.js @@ -56,4 +56,8 @@ function main( // [END automl_vision_object_detection_create_model] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/vision_object_detection_deploy_model_node_count.js b/automl/snippets/vision_object_detection_deploy_model_node_count.js index 9b774e59db5..90fb1d66b55 100644 --- a/automl/snippets/vision_object_detection_deploy_model_node_count.js +++ b/automl/snippets/vision_object_detection_deploy_model_node_count.js @@ -53,4 +53,8 @@ function main( // [END automl_vision_object_detection_deploy_model_node_count] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2)); diff --git a/automl/snippets/vision_object_detection_predict.js b/automl/snippets/vision_object_detection_predict.js index 528dd817c03..dcf24a726d2 100644 --- a/automl/snippets/vision_object_detection_predict.js +++ b/automl/snippets/vision_object_detection_predict.js @@ -74,4 +74,8 @@ function main( // [END automl_vision_object_detection_predict] } +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); main(...process.argv.slice(2));