From b488808b309312e2b0d7e8292fb0968e7612af32 Mon Sep 17 00:00:00 2001 From: sheldy <85823514+sheldygg@users.noreply.github.com> Date: Wed, 4 Jun 2025 19:17:14 +0200 Subject: [PATCH] Correctly pass error message in `TelegramMigrateToChat` (#1694) * Correctly pass error message in `TelegramMigrateToChat` * Add changes file. --- CHANGES/1694.bugfix.rst | 1 + aiogram/exceptions.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 CHANGES/1694.bugfix.rst diff --git a/CHANGES/1694.bugfix.rst b/CHANGES/1694.bugfix.rst new file mode 100644 index 00000000..62f39741 --- /dev/null +++ b/CHANGES/1694.bugfix.rst @@ -0,0 +1 @@ +Correctly pass error message in TelegramMigrateToChat. diff --git a/aiogram/exceptions.py b/aiogram/exceptions.py index a1b73d56..9f609d51 100644 --- a/aiogram/exceptions.py +++ b/aiogram/exceptions.py @@ -119,7 +119,7 @@ class TelegramMigrateToChat(TelegramAPIError): if chat_id := getattr(method, "chat_id", None): description += f" from {chat_id}" description += f"\nOriginal description: {message}" - super().__init__(method=method, message=message) + super().__init__(method=method, message=description) self.migrate_to_chat_id = migrate_to_chat_id