mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user