Closed shosaman closed 5 years ago
This is working as intended.
If so, when I say continue in the 2nd level except, it should go to next element of FOR loop rather than erroring out and does not process next loops of FOR
Your issue is formatted very poorly, and only get_entity
will raise ValueError
, not raw methods.
Thank you for the information. So how can I catch this raw method client(functions.contacts.ImportContactsRequest(....) if this has successfully given anything or not - I do not see any documentation on this particular function call. Please help. Thank you in advance.
Checklist
pip install -U https://github.com/LonamiWebs/Telethon/archive/master.zip
and triggered the bug in the latest version.Code that causes the issue
So except inside another except - I'm not able to make it work. Please help if I'm not doing it right - is this how it is intended to work
Traceback
Traceback (most recent call last): File "TelegramNew.py", line 117, in
username = client.get_entity(UserPhoneNumber)
File "/home/shosaman/.local/lib/python3.6/site-packages/telethon/sync.py", line 39, in syncified
return loop.run_until_complete(coro)
File "/usr/lib/python3.6/asyncio/base_events.py", line 473, in run_until_complete
return future.result()
File "/home/shosaman/.local/lib/python3.6/site-packages/telethon/client/users.py", line 285, in get_entity
result.append(await self._get_entity_from_string(x))
File "/home/shosaman/.local/lib/python3.6/site-packages/telethon/client/users.py", line 521, in _get_entity_from_string
'Cannot find any entity corresponding to "{}"'.format(string)
ValueError: Cannot find any entity corresponding to "+919449019181"
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "TelegramNew.py", line 134, in
username = client.get_entity(UserPhoneNumber)
File "/home/shosaman/.local/lib/python3.6/site-packages/telethon/sync.py", line 39, in syncified
return loop.run_until_complete(coro)
File "/usr/lib/python3.6/asyncio/base_events.py", line 473, in run_until_complete
return future.result()
File "/home/shosaman/.local/lib/python3.6/site-packages/telethon/client/users.py", line 285, in get_entity
result.append(await self._get_entity_from_string(x))
File "/home/shosaman/.local/lib/python3.6/site-packages/telethon/client/users.py", line 521, in _get_entity_from_string
'Cannot find any entity corresponding to "{}"'.format(string)
ValueError: Cannot find any entity corresponding to "+919449019181"