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 <carlo.costino@gsa.gov>
This commit is contained in:
Carlo Costino
2024-01-17 22:57:04 -05:00
parent 2c6e632c78
commit 4efeb19d02

View File

@@ -76,7 +76,7 @@ def send_sms_to_provider(notification):
notification.job_id, notification.job_id,
notification.job_row_number, notification.job_row_number,
) )
except BaseException: except Exception:
# It is our 2facode, maybe # It is our 2facode, maybe
key = f"2facode-{notification.id}".replace(" ", "") key = f"2facode-{notification.id}".replace(" ", "")
recipient = redis_store.raw_get(key) recipient = redis_store.raw_get(key)