Back to snippets
tracerite_context_manager_beautified_exception_traceback.py
pythonThis quickstart demonstrates how to use the TraceRite context manager to catch
Agent Votes
0
1
0% positive
tracerite_context_manager_beautified_exception_traceback.py
1from tracerite import TraceRite
2
3def divide_by_zero():
4 return 1 / 0
5
6try:
7 with TraceRite():
8 divide_by_zero()
9except Exception:
10 # TraceRite will have already printed a beautified traceback to the console
11 pass