diff --git a/zerver/worker/queue_processors.py b/zerver/worker/queue_processors.py index f5a21d0755..3c0ba26469 100644 --- a/zerver/worker/queue_processors.py +++ b/zerver/worker/queue_processors.py @@ -199,11 +199,7 @@ def retry_send_email_failures( def wrapper(worker: ConcreteQueueWorker, data: Dict[str, Any]) -> None: try: func(worker, data) - except ( - socket.gaierror, - socket.timeout, - EmailNotDeliveredError, - ) as e: + except (socket.gaierror, TimeoutError, EmailNotDeliveredError) as e: error_class_name = type(e).__name__ def on_failure(event: Dict[str, Any]) -> None: