From 647f0b88e06140bf9322d5e050399680090402b3 Mon Sep 17 00:00:00 2001 From: Dmitry Orlov Date: Tue, 21 Feb 2023 01:21:14 +0300 Subject: [PATCH] add forgotten set_close_reason for channel --- aiormq/channel.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aiormq/channel.py b/aiormq/channel.py index 4d79f54..333838a 100644 --- a/aiormq/channel.py +++ b/aiormq/channel.py @@ -397,6 +397,12 @@ async def _on_cancel_frame( async def _on_close_frame(self, frame: spec.Channel.Close) -> None: exc: BaseException = exception_by_code(frame) + self.set_close_reason( + frame.reply_code or -1, + frame.reply_text or "", + frame.class_id or -1, + frame.method_id or -1 + ) self.write_queue.put_nowait( ChannelFrame.marshall( channel_number=self.number,