Skip to content

Commit

Permalink
chore: refactored samples to catch missing exception (#511)
Browse files Browse the repository at this point in the history
* chore: refactored samples to catch missing exception

* chore: fixed mismatched region tag
  • Loading branch information
munkhuushmgl authored and Ace Nassri committed Nov 14, 2022
1 parent 7b18f91 commit 675c526
Show file tree
Hide file tree
Showing 48 changed files with 193 additions and 0 deletions.
4 changes: 4 additions & 0 deletions automl/batch_predict.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/beta/batch_predict.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/beta/delete-dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/beta/delete-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
5 changes: 5 additions & 0 deletions automl/beta/get-model-evaluation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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));
4 changes: 4 additions & 0 deletions automl/beta/get-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/beta/get-operation-status.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/beta/import-dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/beta/list-datasets.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/beta/list-models.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/beta/video-classification-create-dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/beta/video-classification-create-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/beta/video-object-tracking-create-dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/beta/video-object-tracking-create-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/delete_dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/delete_model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/deploy_model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/export_dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/get_dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/get_model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/get_model_evaluation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/get_operation_status.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/import_dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/language_entity_extraction_create_dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/language_entity_extraction_create_model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/language_entity_extraction_predict.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/language_sentiment_analysis_create_dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/language_sentiment_analysis_create_model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/language_sentiment_analysis_predict.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/language_text_classification_create_dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/language_text_classification_create_model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/language_text_classification_predict.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/list_datasets.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/list_model_evaluations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/list_models.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/list_operation_status.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/translate_create_dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/translate_create_model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/translate_predict.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/undeploy_model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/vision_classification_create_dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/vision_classification_create_model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
4 changes: 4 additions & 0 deletions automl/vision_classification_deploy_model_node_count.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Loading

0 comments on commit 675c526

Please sign in to comment.