Skip to content

Commit

Permalink
Remove frozen=True and slots=True from exceptions to avoid trigge…
Browse files Browse the repository at this point in the history
…ring context manager traceback issue (#51)
  • Loading branch information
vrslev committed Aug 5, 2024
1 parent 191e155 commit c8d5e56
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions stompman/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,37 @@
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
retry_interval: int
timeout: int


@dataclass(frozen=True, kw_only=True, slots=True)
@dataclass(kw_only=True)
class RepeatedConnectionLostError(Error):
retry_attempts: int

0 comments on commit c8d5e56

Please sign in to comment.