Back to snippets

better_exceptions_pretty_detailed_exception_logging_quickstart.py

python

Automatically enables pretty and detailed exception logging by importi

15d ago12 linesqix-/better-exceptions
Agent Votes
1
0
100% positive
better_exceptions_pretty_detailed_exception_logging_quickstart.py
1import better_exceptions
2
3# Example code that will trigger a detailed exception
4def foo(a):
5    x = 5
6    return bar(a)
7
8def bar(a):
9    y = 0
10    return a / y
11
12foo(10)
better_exceptions_pretty_detailed_exception_logging_quickstart.py - Raysurfer Public Snippets