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
dfirova and gcf-owl-bot[bot] authored Aug 10, 2022
1 parent 4662b6c commit 15aa9cc
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 15aa9cc

Please sign in to comment.