diff --git a/yapw/clients.py b/yapw/clients.py index 5554352..2258d2d 100644 --- a/yapw/clients.py +++ b/yapw/clients.py @@ -52,6 +52,7 @@ class Client(clients.Threaded, clients.Durable, clients.Blocking, clients.Base): from typing import Any, Callable, List, Optional, Set, Tuple import pika +import pika.exceptions from pika.exchange_type import ExchangeType from yapw.decorators import default_decode, halt @@ -327,7 +328,7 @@ def consume( for thread in threads: thread.join() # The connection is already closed. - except Exception: + else: for thread in threads: thread.join() self.connection.close()