Skip to content

Commit

Permalink
chore (samples) Refactored error handling check for import product fr…
Browse files Browse the repository at this point in the history
…om GCS. (#505)

* Refactored error handling check.

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* PR fix: refactoring.

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and Shabirmean committed Nov 15, 2022
1 parent 7ae3911 commit d7012b1
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ public static void main(String[] args) throws IOException, InterruptedException
"projects/%s/locations/global/catalogs/default_catalog/branches/0", projectId);
String gcsBucket = String.format("gs://%s", System.getenv("BUCKET_NAME"));
String gcsErrorBucket = String.format("%s/errors", gcsBucket);
String gscProductsObject = "products.json";
// TO CHECK ERROR HANDLING USE THE JSON WITH INVALID PRODUCT
// GCS_PRODUCTS_OBJECT = "products_some_invalid.json"
String gcsProductsObject = "products.json";
// To check error handling, use an invalid product JSON.
// gcsProductsObject = "products_some_invalid.json";

ImportProductsRequest importGcsRequest =
getImportProductsGcsRequest(gscProductsObject, gcsBucket, gcsErrorBucket, branchName);
getImportProductsGcsRequest(gcsProductsObject, gcsBucket, gcsErrorBucket, branchName);
waitForOperationCompletion(importGcsRequest);
}

Expand Down

0 comments on commit d7012b1

Please sign in to comment.