Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: catch UserNameNotOccupiedErrors while rehydrating #46

Closed
pekasen opened this issue Apr 21, 2023 · 0 comments · Fixed by #47
Closed

bug: catch UserNameNotOccupiedErrors while rehydrating #46

pekasen opened this issue Apr 21, 2023 · 0 comments · Fixed by #47
Labels
bug Something isn't working

Comments

@pekasen
Copy link
Member

pekasen commented Apr 21, 2023

Traceback (most recent call last):
  File "/home/ec2-user/.local/pipx/venvs/tegracli/lib64/python3.8/site-packages/telethon/client/users.py", line 548, in _get_entity_from_string
    result = await self(
  File "/home/ec2-user/.local/pipx/venvs/tegracli/lib64/python3.8/site-packages/telethon/client/users.py", line 30, in __call__
    return await self._call(self._sender, request, ordered=ordered)
  File "/home/ec2-user/.local/pipx/venvs/tegracli/lib64/python3.8/site-packages/telethon/client/users.py", line 83, in _call
    result = await future
telethon.errors.rpcerrorlist.UsernameNotOccupiedError: The username is not in use by anyone else yet (caused by ResolveUsernameRequest)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/ec2-user/.local/bin/tegracli", line 8, in <module>
    sys.exit(cli())
  File "/home/ec2-user/.local/pipx/venvs/tegracli/lib64/python3.8/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/ec2-user/.local/pipx/venvs/tegracli/lib64/python3.8/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/ec2-user/.local/pipx/venvs/tegracli/lib64/python3.8/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ec2-user/.local/pipx/venvs/tegracli/lib64/python3.8/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ec2-user/.local/pipx/venvs/tegracli/lib64/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/ec2-user/.local/pipx/venvs/tegracli/lib64/python3.8/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/ec2-user/.local/pipx/venvs/tegracli/lib64/python3.8/site-packages/tegracli/main.py", line 105, in hydrate
    client.loop.run_until_complete(
  File "/usr/lib64/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/home/ec2-user/.local/pipx/venvs/tegracli/lib64/python3.8/site-packages/tegracli/dispatch.py", line 80, in dispatch_hydrate
    await dispatch_iter_messages(
  File "/home/ec2-user/.local/pipx/venvs/tegracli/lib64/python3.8/site-packages/tegracli/dispatch.py", line 34, in dispatch_iter_messages
    async for message in client.iter_messages(wait_time=10, **params):
  File "/home/ec2-user/.local/pipx/venvs/tegracli/lib64/python3.8/site-packages/telethon/requestiter.py", line 58, in __anext__
    if await self._init(**self.kwargs):
  File "/home/ec2-user/.local/pipx/venvs/tegracli/lib64/python3.8/site-packages/telethon/client/messages.py", line 289, in _init
    self._entity = (await self.client.get_input_entity(entity)) if entity else None
  File "/home/ec2-user/.local/pipx/venvs/tegracli/lib64/python3.8/site-packages/telethon/client/users.py", line 432, in get_input_entity
    await self._get_entity_from_string(peer))
  File "/home/ec2-user/.local/pipx/venvs/tegracli/lib64/python3.8/site-packages/telethon/client/users.py", line 551, in _get_entity_from_string
    raise ValueError('No user has "{}" as username'
@pekasen pekasen changed the title bug: bug: catch UserNameNotOccupiedErrors while rehydrating Apr 21, 2023
@pekasen pekasen added the bug Something isn't working label Apr 21, 2023
@pekasen pekasen linked a pull request Apr 21, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant