From f466983dc855476d7db864da3428151ae6ae65e1 Mon Sep 17 00:00:00 2001 From: Lev Vereshchagin Date: Wed, 27 Aug 2025 12:43:18 +0300 Subject: [PATCH] Add default error logging to STOMP client --- packages/stompman/stompman/client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/stompman/stompman/client.py b/packages/stompman/stompman/client.py index 47dced1..c0196e7 100644 --- a/packages/stompman/stompman/client.py +++ b/packages/stompman/stompman/client.py @@ -20,6 +20,7 @@ ReceiptFrame, SendFrame, ) +from stompman.logger import LOGGER from stompman.subscription import AckableMessageFrame, ActiveSubscriptions, AutoAckSubscription, ManualAckSubscription from stompman.transaction import Transaction @@ -29,7 +30,9 @@ class Client: PROTOCOL_VERSION: ClassVar = "1.2" # https://stomp.github.io/stomp-specification-1.2.html servers: list[ConnectionParameters] = field(kw_only=False) - on_error_frame: Callable[[ErrorFrame], Any] | None = None + on_error_frame: Callable[[ErrorFrame], Any] | None = lambda error_frame: LOGGER.error( + "received error frame: %s", error_frame + ) heartbeat: Heartbeat = field(default=Heartbeat(1000, 1000)) ssl: Literal[True] | SSLContext | None = None