ruff: Fix UP041 Replace aliased errors with `TimeoutError`.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2024-04-01 15:38:57 -07:00 committed by Tim Abbott
parent 6e871e7731
commit 7e2ef11f61
1 changed files with 1 additions and 5 deletions

View File

@ -199,11 +199,7 @@ def retry_send_email_failures(
def wrapper(worker: ConcreteQueueWorker, data: Dict[str, Any]) -> None: def wrapper(worker: ConcreteQueueWorker, data: Dict[str, Any]) -> None:
try: try:
func(worker, data) func(worker, data)
except ( except (socket.gaierror, TimeoutError, EmailNotDeliveredError) as e:
socket.gaierror,
socket.timeout,
EmailNotDeliveredError,
) as e:
error_class_name = type(e).__name__ error_class_name = type(e).__name__
def on_failure(event: Dict[str, Any]) -> None: def on_failure(event: Dict[str, Any]) -> None: