Skip to content

More verbose tracebacks on exceptions in event loop  #541

Open
@Czaki

Description

@Czaki

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions