Use shell.showtraceback function

This commit is contained in:
Grant Sanderson 2024-12-12 10:04:59 -06:00
parent c1b52bf572
commit 8ff8f984d9

View file

@ -102,7 +102,7 @@ class InteractiveSceneEmbed:
"""Flash border, and potentially play sound, on exceptions"""
def custom_exc(shell, etype, evalue, tb, tb_offset=None):
# Show the error don't just swallow it
print(''.join(traceback.format_exception(etype, evalue, tb)))
shell.showtraceback((etype, evalue, tb), tb_offset=tb_offset)
rect = FullScreenRectangle().set_stroke(RED, 30).set_fill(opacity=0)
rect.fix_in_frame()
self.scene.play(VFadeInThenOut(rect, run_time=0.5))