Skip to content

Commit 6425517

Browse files
authored
Log error frames by default (#143)
1 parent dd14c10 commit 6425517

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/stompman/stompman/client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
ReceiptFrame,
2121
SendFrame,
2222
)
23+
from stompman.logger import LOGGER
2324
from stompman.subscription import AckableMessageFrame, ActiveSubscriptions, AutoAckSubscription, ManualAckSubscription
2425
from stompman.transaction import Transaction
2526

@@ -29,7 +30,9 @@ class Client:
2930
PROTOCOL_VERSION: ClassVar = "1.2" # https://stomp.github.io/stomp-specification-1.2.html
3031

3132
servers: list[ConnectionParameters] = field(kw_only=False)
32-
on_error_frame: Callable[[ErrorFrame], Any] | None = None
33+
on_error_frame: Callable[[ErrorFrame], Any] | None = lambda error_frame: LOGGER.error(
34+
"received error frame: %s", error_frame
35+
)
3336

3437
heartbeat: Heartbeat = field(default=Heartbeat(1000, 1000))
3538
ssl: Literal[True] | SSLContext | None = None

0 commit comments

Comments
 (0)