From 338b35e1c9414ba29de5aa6dd35752ce07ee9940 Mon Sep 17 00:00:00 2001 From: rewby Date: Thu, 31 Aug 2023 19:18:52 +0200 Subject: [PATCH] Don't crash on existing bucket. --- main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index c74c198..da2803a 100755 --- a/main.py +++ b/main.py @@ -196,7 +196,9 @@ def single_impl(item_directory: pathlib.Path, ia_collection: str, ia_item_title: def make_bucket(): logging.info("Attempting to make bucket...") if client.bucket_exists(bucket_name=bucket_name): - raise Exception("Bucket already exists!") + # If bucket already exists a previous attempt was aborted. + logging.warning("Bucket already exists!") + return client.make_bucket(bucket_name=bucket_name) retry_failures(make_bucket, "Failed to make bucket")