From 675c526020934359078397fab58dee15be058868 Mon Sep 17 00:00:00 2001 From: Mike <45373284+munkhuushmgl@users.noreply.github.com> Date: Mon, 24 May 2021 16:27:25 -0700 Subject: [PATCH] chore: refactored samples to catch missing exception (#511) * chore: refactored samples to catch missing exception * chore: fixed mismatched region tag --- automl/batch_predict.js | 4 ++++ automl/beta/batch_predict.js | 4 ++++ automl/beta/delete-dataset.js | 4 ++++ automl/beta/delete-model.js | 4 ++++ automl/beta/get-model-evaluation.js | 5 +++++ automl/beta/get-model.js | 4 ++++ automl/beta/get-operation-status.js | 4 ++++ automl/beta/import-dataset.js | 4 ++++ automl/beta/list-datasets.js | 4 ++++ automl/beta/list-models.js | 4 ++++ automl/beta/video-classification-create-dataset.js | 4 ++++ automl/beta/video-classification-create-model.js | 4 ++++ automl/beta/video-object-tracking-create-dataset.js | 4 ++++ automl/beta/video-object-tracking-create-model.js | 4 ++++ automl/delete_dataset.js | 4 ++++ automl/delete_model.js | 4 ++++ automl/deploy_model.js | 4 ++++ automl/export_dataset.js | 4 ++++ automl/get_dataset.js | 4 ++++ automl/get_model.js | 4 ++++ automl/get_model_evaluation.js | 4 ++++ automl/get_operation_status.js | 4 ++++ automl/import_dataset.js | 4 ++++ automl/language_entity_extraction_create_dataset.js | 4 ++++ automl/language_entity_extraction_create_model.js | 4 ++++ automl/language_entity_extraction_predict.js | 4 ++++ automl/language_sentiment_analysis_create_dataset.js | 4 ++++ automl/language_sentiment_analysis_create_model.js | 4 ++++ automl/language_sentiment_analysis_predict.js | 4 ++++ automl/language_text_classification_create_dataset.js | 4 ++++ automl/language_text_classification_create_model.js | 4 ++++ automl/language_text_classification_predict.js | 4 ++++ automl/list_datasets.js | 4 ++++ automl/list_model_evaluations.js | 4 ++++ automl/list_models.js | 4 ++++ automl/list_operation_status.js | 4 ++++ automl/translate_create_dataset.js | 4 ++++ automl/translate_create_model.js | 4 ++++ automl/translate_predict.js | 4 ++++ automl/undeploy_model.js | 4 ++++ automl/vision_classification_create_dataset.js | 4 ++++ automl/vision_classification_create_model.js | 4 ++++ automl/vision_classification_deploy_model_node_count.js | 4 ++++ automl/vision_classification_predict.js | 4 ++++ automl/vision_object_detection_create_dataset.js | 4 ++++ automl/vision_object_detection_create_model.js | 4 ++++ automl/vision_object_detection_deploy_model_node_count.js | 4 ++++ automl/vision_object_detection_predict.js | 4 ++++ 48 files changed, 193 insertions(+) diff --git a/automl/batch_predict.js b/automl/batch_predict.js index be959c236a8..e39c2299bac 100644 --- a/automl/batch_predict.js +++ b/automl/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/beta/batch_predict.js b/automl/beta/batch_predict.js index af95de6c820..832ee7c63d8 100644 --- a/automl/beta/batch_predict.js +++ b/automl/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/beta/delete-dataset.js b/automl/beta/delete-dataset.js index 4044d61dfb4..4aae984f38d 100644 --- a/automl/beta/delete-dataset.js +++ b/automl/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/beta/delete-model.js b/automl/beta/delete-model.js index e409a7b9b2e..0a3d61c420d 100644 --- a/automl/beta/delete-model.js +++ b/automl/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/beta/get-model-evaluation.js b/automl/beta/get-model-evaluation.js index 1081cbab019..8ab4dac4c5f 100644 --- a/automl/beta/get-model-evaluation.js +++ b/automl/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/beta/get-model.js b/automl/beta/get-model.js index d78cc930d1c..16583398dae 100644 --- a/automl/beta/get-model.js +++ b/automl/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/beta/get-operation-status.js b/automl/beta/get-operation-status.js index 1d47396aeb2..d11ec2506c8 100644 --- a/automl/beta/get-operation-status.js +++ b/automl/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/beta/import-dataset.js b/automl/beta/import-dataset.js index 54f41ea0829..37d76512148 100644 --- a/automl/beta/import-dataset.js +++ b/automl/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/beta/list-datasets.js b/automl/beta/list-datasets.js index 2c0c5758d45..4668638102e 100644 --- a/automl/beta/list-datasets.js +++ b/automl/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/beta/list-models.js b/automl/beta/list-models.js index 2f3ff570f3c..9f392acdfa1 100644 --- a/automl/beta/list-models.js +++ b/automl/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/beta/video-classification-create-dataset.js b/automl/beta/video-classification-create-dataset.js index 55a5c1b670b..d345c8209c1 100644 --- a/automl/beta/video-classification-create-dataset.js +++ b/automl/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/beta/video-classification-create-model.js b/automl/beta/video-classification-create-model.js index 71e378fb463..ca7c1eb04ca 100644 --- a/automl/beta/video-classification-create-model.js +++ b/automl/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/beta/video-object-tracking-create-dataset.js b/automl/beta/video-object-tracking-create-dataset.js index 9ecf0f375ab..561e65fe77e 100644 --- a/automl/beta/video-object-tracking-create-dataset.js +++ b/automl/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/beta/video-object-tracking-create-model.js b/automl/beta/video-object-tracking-create-model.js index 2131034bb1d..7a93864d737 100644 --- a/automl/beta/video-object-tracking-create-model.js +++ b/automl/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/delete_dataset.js b/automl/delete_dataset.js index 98d55cb7eca..ef882e524aa 100644 --- a/automl/delete_dataset.js +++ b/automl/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/delete_model.js b/automl/delete_model.js index a5e921275cc..686d6621902 100644 --- a/automl/delete_model.js +++ b/automl/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/deploy_model.js b/automl/deploy_model.js index 3f3b3c53fbe..b51c43f5f5d 100644 --- a/automl/deploy_model.js +++ b/automl/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/export_dataset.js b/automl/export_dataset.js index cc89fd586e8..89f8710d28a 100644 --- a/automl/export_dataset.js +++ b/automl/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/get_dataset.js b/automl/get_dataset.js index e5be41ee4f4..8cee2686308 100644 --- a/automl/get_dataset.js +++ b/automl/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/get_model.js b/automl/get_model.js index 477f627aa3b..1ebc265c096 100644 --- a/automl/get_model.js +++ b/automl/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/get_model_evaluation.js b/automl/get_model_evaluation.js index aefb03bf442..724c6cf224c 100644 --- a/automl/get_model_evaluation.js +++ b/automl/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/get_operation_status.js b/automl/get_operation_status.js index bd6f3c55380..a503550e90e 100644 --- a/automl/get_operation_status.js +++ b/automl/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/import_dataset.js b/automl/import_dataset.js index fe4bdb14f78..72815f68b7f 100644 --- a/automl/import_dataset.js +++ b/automl/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/language_entity_extraction_create_dataset.js b/automl/language_entity_extraction_create_dataset.js index b5fd37658ec..ba31bee259a 100644 --- a/automl/language_entity_extraction_create_dataset.js +++ b/automl/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/language_entity_extraction_create_model.js b/automl/language_entity_extraction_create_model.js index 0f6c5bd5c0e..53b4dea68de 100644 --- a/automl/language_entity_extraction_create_model.js +++ b/automl/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/language_entity_extraction_predict.js b/automl/language_entity_extraction_predict.js index f5c6c7d4f91..f98b8a2010b 100644 --- a/automl/language_entity_extraction_predict.js +++ b/automl/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/language_sentiment_analysis_create_dataset.js b/automl/language_sentiment_analysis_create_dataset.js index d146d4e12ea..8f406b5c711 100644 --- a/automl/language_sentiment_analysis_create_dataset.js +++ b/automl/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/language_sentiment_analysis_create_model.js b/automl/language_sentiment_analysis_create_model.js index dff8107d3b5..76f559ab0c8 100644 --- a/automl/language_sentiment_analysis_create_model.js +++ b/automl/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/language_sentiment_analysis_predict.js b/automl/language_sentiment_analysis_predict.js index a20b761653d..44d8a20959b 100644 --- a/automl/language_sentiment_analysis_predict.js +++ b/automl/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/language_text_classification_create_dataset.js b/automl/language_text_classification_create_dataset.js index bd68f1a9558..afe3ffdb745 100644 --- a/automl/language_text_classification_create_dataset.js +++ b/automl/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/language_text_classification_create_model.js b/automl/language_text_classification_create_model.js index 2a80814367e..8292e2ebaa3 100644 --- a/automl/language_text_classification_create_model.js +++ b/automl/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/language_text_classification_predict.js b/automl/language_text_classification_predict.js index ab680e9781e..1e7b77b8764 100644 --- a/automl/language_text_classification_predict.js +++ b/automl/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/list_datasets.js b/automl/list_datasets.js index be9bbdf4403..555d8230931 100644 --- a/automl/list_datasets.js +++ b/automl/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/list_model_evaluations.js b/automl/list_model_evaluations.js index ca9d248b08d..d8cd6bb070a 100644 --- a/automl/list_model_evaluations.js +++ b/automl/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/list_models.js b/automl/list_models.js index 0fe0ac219e1..1a6a4600ea5 100644 --- a/automl/list_models.js +++ b/automl/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/list_operation_status.js b/automl/list_operation_status.js index 49c98effd01..9d1630d2a68 100644 --- a/automl/list_operation_status.js +++ b/automl/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/translate_create_dataset.js b/automl/translate_create_dataset.js index 53695ad89e3..b4be3e624d9 100644 --- a/automl/translate_create_dataset.js +++ b/automl/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/translate_create_model.js b/automl/translate_create_model.js index 550df01aea9..a4bf34546ec 100644 --- a/automl/translate_create_model.js +++ b/automl/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/translate_predict.js b/automl/translate_predict.js index 7e69d2c4c30..cbdcfb127ba 100644 --- a/automl/translate_predict.js +++ b/automl/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/undeploy_model.js b/automl/undeploy_model.js index 1ac93035c90..35ac9781898 100644 --- a/automl/undeploy_model.js +++ b/automl/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/vision_classification_create_dataset.js b/automl/vision_classification_create_dataset.js index ed63a2800e8..b2e8184bbb3 100644 --- a/automl/vision_classification_create_dataset.js +++ b/automl/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/vision_classification_create_model.js b/automl/vision_classification_create_model.js index 1c2e3558a91..fefa29648c4 100644 --- a/automl/vision_classification_create_model.js +++ b/automl/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/vision_classification_deploy_model_node_count.js b/automl/vision_classification_deploy_model_node_count.js index d9844d2ccee..80971ba1e69 100644 --- a/automl/vision_classification_deploy_model_node_count.js +++ b/automl/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/vision_classification_predict.js b/automl/vision_classification_predict.js index 9e34c0822f7..a46fac2591d 100644 --- a/automl/vision_classification_predict.js +++ b/automl/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/vision_object_detection_create_dataset.js b/automl/vision_object_detection_create_dataset.js index 88fefca1232..bfa74cff138 100644 --- a/automl/vision_object_detection_create_dataset.js +++ b/automl/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/vision_object_detection_create_model.js b/automl/vision_object_detection_create_model.js index 1530483979a..ef8922c177b 100644 --- a/automl/vision_object_detection_create_model.js +++ b/automl/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/vision_object_detection_deploy_model_node_count.js b/automl/vision_object_detection_deploy_model_node_count.js index 9b774e59db5..90fb1d66b55 100644 --- a/automl/vision_object_detection_deploy_model_node_count.js +++ b/automl/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/vision_object_detection_predict.js b/automl/vision_object_detection_predict.js index 528dd817c03..dcf24a726d2 100644 --- a/automl/vision_object_detection_predict.js +++ b/automl/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));