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

fix: catch async errors #40

Closed
pekasen opened this issue Apr 6, 2023 · 1 comment · Fixed by #42
Closed

fix: catch async errors #40

pekasen opened this issue Apr 6, 2023 · 1 comment · Fixed by #42
Assignees

Comments

@pekasen
Copy link
Member

pekasen commented Apr 6, 2023

Traceback (most recent call last):
  File "~/.local/bin/tegracli", line 8, in <module>
    sys.exit(cli())
  File "~/.local/pipx/venvs/tegracli/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "~/.local/pipx/venvs/tegracli/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "~/.local/pipx/venvs/tegracli/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "~/.local/pipx/venvs/tegracli/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "~/.local/pipx/venvs/tegracli/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "~/.local/pipx/venvs/tegracli/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "~/.local/pipx/venvs/tegracli/lib/python3.9/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "~/.local/pipx/venvs/tegracli/lib/python3.9/site-packages/tegracli/main.py", line 224, in run
    run_group(ctx.obj["client"], groups)
  File "~/.local/pipx/venvs/tegracli/lib/python3.9/site-packages/tegracli/main.py", line 316, in run_group
    client.loop.run_until_complete(
  File "~/.pyenv/versions/3.9.12/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
    return future.result()
  File "~/.local/pipx/venvs/tegracli/lib/python3.9/site-packages/tegracli/dispatch.py", line 30, in dispatch_iter_messages
    async for message in client.iter_messages(wait_time=10, **params):
  File "~/.local/pipx/venvs/tegracli/lib/python3.9/site-packages/telethon/requestiter.py", line 74, in __anext__
    if await self._load_next_chunk():
  File "~/.local/pipx/venvs/tegracli/lib/python3.9/site-packages/telethon/client/messages.py", line 184, in _load_next_chunk
    r = await self.client(self.request)
  File "~/.local/pipx/venvs/tegracli/lib/python3.9/site-packages/telethon/client/users.py", line 30, in __call__
    return await self._call(self._sender, request, ordered=ordered)
  File "~/.local/pipx/venvs/tegracli/lib/python3.9/site-packages/telethon/client/users.py", line 84, in _call
    result = await future
telethon.errors.rpcerrorlist.UserDeactivatedError: The user has been deleted/deactivated (caused by GetHistoryRequest)
@pekasen
Copy link
Member Author

pekasen commented Apr 12, 2023

Similar behavior as here:

Traceback (most recent call last):
  File "~/repos/tegracli/.venv/bin/tegracli", line 6, in <module>
    sys.exit(cli())
  File "~/repos/tegracli/.venv/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "~/repos/tegracli/.venv/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "~/repos/tegracli/.venv/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "~/repos/tegracli/.venv/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "~/repos/tegracli/.venv/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "~/repos/tegracli/.venv/lib/python3.9/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "~/repos/tegracli/tegracli/main.py", line 104, in hydrate
    client.loop.run_until_complete(
  File "~/.pyenv/versions/3.9.0/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "~/repos/tegracli/tegracli/dispatch.py", line 73, in dispatch_hydrate
    await dispatch_iter_messages(
  File "~/repos/tegracli/tegracli/dispatch.py", line 32, in dispatch_iter_messages
    async for message in client.iter_messages(wait_time=10, **params):
  File "~/repos/tegracli/.venv/lib/python3.9/site-packages/telethon/requestiter.py", line 74, in __anext__
    if await self._load_next_chunk():
  File "~/repos/tegracli/.venv/lib/python3.9/site-packages/telethon/client/messages.py", line 289, in _load_next_chunk
    r = await self.client(
  File "~/repos/tegracli/.venv/lib/python3.9/site-packages/telethon/client/users.py", line 30, in __call__
    return await self._call(self._sender, request, ordered=ordered)
  File "~/repos/tegracli/.venv/lib/python3.9/site-packages/telethon/client/users.py", line 84, in _call
    result = await future
telethon.errors.rpcerrorlist.ChannelPrivateError: The channel specified is private and you lack permission to access it. Another reason may be that you were banned from it (caused by GetMessagesRequest)

@pekasen pekasen changed the title fix: log UserDeactivedErrors fix: catch async errors Apr 12, 2023
@pekasen pekasen self-assigned this Apr 12, 2023
@pekasen pekasen linked a pull request Apr 12, 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
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant