From 4efeb19d022a71424198fe474dce46dd3a10ec71 Mon Sep 17 00:00:00 2001 From: Carlo Costino Date: Wed, 17 Jan 2024 22:57:04 -0500 Subject: [PATCH] Update try/except block to catch Exception This changeset updates a try/except block to catch Exception instead of BaseException. Using BaseException is an anti-pattern and is not intended for user-defined code; it can also lead to other unintended side effects if not handled properly. This is enough of a concern that the new release of flake8-bugbear now issues warnings when it sees BaseException being caught without an immediate re-raise. Signed-off-by: Carlo Costino --- app/delivery/send_to_providers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/delivery/send_to_providers.py b/app/delivery/send_to_providers.py index 6db858eed..9590f5bd6 100644 --- a/app/delivery/send_to_providers.py +++ b/app/delivery/send_to_providers.py @@ -76,7 +76,7 @@ def send_sms_to_provider(notification): notification.job_id, notification.job_row_number, ) - except BaseException: + except Exception: # It is our 2facode, maybe key = f"2facode-{notification.id}".replace(" ", "") recipient = redis_store.raw_get(key)