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

When exception is raised, the "Current traceback" window is empty #429

Closed
zwn opened this issue Feb 16, 2024 · 3 comments · Fixed by #431
Closed

When exception is raised, the "Current traceback" window is empty #429

zwn opened this issue Feb 16, 2024 · 3 comments · Fixed by #431

Comments

@zwn
Copy link

zwn commented Feb 16, 2024

See result when raising `RuntimeError('example').

image

I need to run the script outside of cq-editor to get the stack trace in console.

I am on Debian, installed cq-editor with micromamba:

cq-editor                             master           0.2_60_g7d74cf7        cadquery 
@lifeisafractal
Copy link

I'm seeing the same issue. I'm on Ubuntu 23.10 using miniforge:

cq-editor                 master          0.2_61_g03df6fa    cadquery

@smurfix
Copy link
Contributor

smurfix commented Apr 8, 2024

Quick fix for this:

diff --git cq_editor/widgets/traceback_viewer.py cq_editor/widgets/traceback_viewer.py
index d5e0baa..4b1043d 100644
--- cq_editor/widgets/traceback_viewer.py
+++ cq_editor/widgets/traceback_viewer.py
@@ -56,6 +56,6 @@ class TracebackPane(QWidget,ComponentMixin):
             root = self.tree.root
             code = code.splitlines()
-            tb = [t for t in extract_tb(tb) if '<string>' in t.filename] #ignore highest frames (debug, exec)
+            tb = [t for t in extract_tb(tb) if 'string>' in t.filename] #ignore highest frames (debug, exec)

             for el in tb:
                 #workaround of the traceback module

smurfix added a commit to smurfix/CQ-editor that referenced this issue Apr 8, 2024
Also trace into external modules.

Closes CadQuery#429.
@smurfix
Copy link
Contributor

smurfix commented Apr 8, 2024

I opened PR #431 with a better fix that doesn't suppress tracebacks in called modules.

They're too helpful for finding the actual problem …

adam-urbanczyk added a commit that referenced this issue Jun 4, 2024
* Show the traceback.

Also trace into external modules.

Closes #429.

* Use itertools for clarity

* Cleanup

* Remove empty line

* Cover new functionality with tests

---------

Co-authored-by: AU <[email protected]>
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.

3 participants