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

More verbose tracebacks on exceptions in event loop #541

Open
Czaki opened this issue Feb 4, 2024 · 1 comment
Open

More verbose tracebacks on exceptions in event loop #541

Czaki opened this issue Feb 4, 2024 · 1 comment

Comments

@Czaki
Copy link
Contributor

Czaki commented Feb 4, 2024

When an exception happens during the event loop, only a tight traceback is printed.

  File "D:\tmp\tox\py39-PyQt5-all\lib\site-packages\napari\utils\events\containers\_evented_list.py", line 195, in insert
      self.events.inserted(index=index, value=value)
    File "D:\tmp\tox\py39-PyQt5-all\lib\site-packages\napari\utils\events\event.py", line 763, in __call__
      self._invoke_callback(cb, event if pass_event else None)
    File "D:\tmp\tox\py39-PyQt5-all\lib\site-packages\napari\utils\events\event.py", line 801, in _invoke_callback
      _handle_exception(
    File "D:\tmp\tox\py39-PyQt5-all\lib\site-packages\napari\utils\events\event.py", line 788, in _invoke_callback
      cb(event)

But it is often not very helpful to debug.

pytest support rich tracebacks https://docs.pytest.org/en/7.1.x/how-to/output.html#modifying-python-traceback-printing

Will you accept PR with such enhancement?

@nicoddemus
Copy link
Member

Hi @Czaki,

Yeah that sounds interesting, specially if the code for it is simple and uses only public APIs, which from the top of my head seems possible. Feel free to give this a go, thanks. 👍

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

No branches or pull requests

2 participants