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

Hide error traceback #39

Closed
tm-a-t opened this issue Apr 12, 2024 · 1 comment
Closed

Hide error traceback #39

tm-a-t opened this issue Apr 12, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@tm-a-t
Copy link
Owner

tm-a-t commented Apr 12, 2024

TGPy messages with errors look quite like random spam, and full error tracebacks are rarely useful.

I am proposing to show only the last line of the error and save the full error to a variable and/or logs.

Example

Current behavior:

msg.something

TGPy> Error occurred

Traceback (most recent call last):
  File "/home/tmat/.local/pipx/venvs/tgpy/lib/python3.11/site-packages/tgpy/_core/meval.py", line 175, in _meval
    new_locs, ret = await getattr(py_module, 'tmp')(**kwargs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "tgpy://message/-1001611149679/38326", line 1, in tmp
    msg.something
AttributeError: 'Message' object has no attribute 'something'

Suggested behavior:

msg.something

TGPy> AttributeError: 'Message' object has no attribute 'something'
@tm-a-t tm-a-t added the enhancement New feature or request label Apr 12, 2024
@tm-a-t tm-a-t self-assigned this Apr 12, 2024
tm-a-t added a commit that referenced this issue Apr 20, 2024
vanutp pushed a commit that referenced this issue Apr 20, 2024
@vanutp
Copy link
Collaborator

vanutp commented Apr 28, 2024

Implemented in 739fbbc

@vanutp vanutp closed this as completed Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants