From 2420e4232e9d4de590545fe01da6e8eb64c49760 Mon Sep 17 00:00:00 2001 From: Denis Date: Thu, 24 Jul 2025 19:38:08 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BA?= =?UTF-8?q?=D0=B0=20Error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- maxapi/utils/message.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/maxapi/utils/message.py b/maxapi/utils/message.py index 37ea9e6..df49ae0 100644 --- a/maxapi/utils/message.py +++ b/maxapi/utils/message.py @@ -7,6 +7,7 @@ from ..types.input_media import InputMedia, InputMediaBuffer from ..enums.upload_type import UploadType from ..exceptions.max import MaxUploadFileFailed from ..types.attachments.upload import AttachmentPayload, AttachmentUpload +from ..types.errors import Error if TYPE_CHECKING: from ..bot import Bot @@ -33,6 +34,9 @@ async def process_input_media( """ upload = await bot.get_upload_url(att.type) + + if isinstance(upload, Error): + raise MaxUploadFileFailed(f'Ошибка при загрузке файла: code={upload.code}, raw={upload.raw}') if isinstance(att, InputMedia): upload_file_response = await base_connection.upload_file(