From c8d5e5623a34fb2ded69897cf86dabb7ca23a91a Mon Sep 17 00:00:00 2001 From: Lev Vereshchagin Date: Mon, 5 Aug 2024 13:14:31 +0300 Subject: [PATCH] Remove `frozen=True` and `slots=True` from exceptions to avoid triggering context manager traceback issue (#51) --- stompman/errors.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/stompman/errors.py b/stompman/errors.py index c9ff44f..6830cb9 100644 --- a/stompman/errors.py +++ b/stompman/errors.py @@ -7,30 +7,30 @@ from stompman.config import ConnectionParameters -@dataclass(frozen=True, kw_only=True, slots=True) +@dataclass(kw_only=True) class Error(Exception): def __str__(self) -> str: return self.__repr__() -@dataclass(frozen=True, kw_only=True, slots=True) +@dataclass(kw_only=True) class ConnectionLostError(Error): """Raised in stompman.AbstractConnection—and handled in stompman.ConnectionManager, therefore is private.""" -@dataclass(frozen=True, kw_only=True, slots=True) +@dataclass(kw_only=True) class ConnectionConfirmationTimeoutError(Error): timeout: int frames: list[MessageFrame | ReceiptFrame | ErrorFrame | HeartbeatFrame] -@dataclass(frozen=True, kw_only=True, slots=True) +@dataclass(kw_only=True) class UnsupportedProtocolVersionError(Error): given_version: str supported_version: str -@dataclass(frozen=True, kw_only=True, slots=True) +@dataclass(kw_only=True) class FailedAllConnectAttemptsError(Error): servers: list["ConnectionParameters"] retry_attempts: int @@ -38,6 +38,6 @@ class FailedAllConnectAttemptsError(Error): timeout: int -@dataclass(frozen=True, kw_only=True, slots=True) +@dataclass(kw_only=True) class RepeatedConnectionLostError(Error): retry_attempts: int