mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-10 19:46:36 +03:00
Improve exception clarity for message parsing failure (#3029)
This commit is contained in:
parent
a376faa3a8
commit
3001b620ec
|
@ -83,7 +83,11 @@ class MessageParseMethods:
|
|||
if not parse_mode:
|
||||
return message, []
|
||||
|
||||
original_message = message
|
||||
message, msg_entities = parse_mode.parse(message)
|
||||
if original_message and not message and not msg_entities:
|
||||
raise ValueError("Failed to parse message")
|
||||
|
||||
for i in reversed(range(len(msg_entities))):
|
||||
e = msg_entities[i]
|
||||
if isinstance(e, types.MessageEntityTextUrl):
|
||||
|
|
Loading…
Reference in New Issue
Block a user