mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-06-18 19:16:43 +00:00
Change error mapping to be case insensitive
This commit is contained in:
parent
584e2b3743
commit
a12b49fd40
@ -24,7 +24,8 @@ def rpc_message_to_error(rpc_error, request):
|
|||||||
:return: the RPCError as a Python exception that represents this error.
|
:return: the RPCError as a Python exception that represents this error.
|
||||||
"""
|
"""
|
||||||
# Try to get the error by direct look-up, otherwise regex
|
# Try to get the error by direct look-up, otherwise regex
|
||||||
cls = rpc_errors_dict.get(rpc_error.error_message, None)
|
# Case-insensitive, for things like "timeout" which don't conform.
|
||||||
|
cls = rpc_errors_dict.get(rpc_error.error_message.upper(), None)
|
||||||
if cls:
|
if cls:
|
||||||
return cls(request=request)
|
return cls(request=request)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user