From 60bfc1f58bcc3115987314447993bcece84db0b5 Mon Sep 17 00:00:00 2001 From: Dmitry Orlov Date: Tue, 21 Feb 2023 01:11:18 +0300 Subject: [PATCH] add forgotten set_close_reason --- aiormq/connection.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/aiormq/connection.py b/aiormq/connection.py index 6956e94..565e24a 100644 --- a/aiormq/connection.py +++ b/aiormq/connection.py @@ -533,7 +533,14 @@ async def __handle_heartbeat(self, _: Heartbeat) -> None: return async def __handle_close(self, frame: spec.Connection.Close) -> None: - log.exception( + self.set_close_reason( + frame.reply_code or -1, + frame.reply_text or "", + frame.class_id or -1, + frame.method_id or -1, + ) + + log.error( "Unexpected connection close from remote \"%s\", " "Connection.Close(reply_code=%r, reply_text=%r)", self, frame.reply_code, frame.reply_text,