I want that whenever an error is raised in my code, traceback.print_exception()
execute so I can have any errors in a file to check… Is it possible somehow?
Advertisement
Answer
You could try wrapping your code in a try/except block, and call the function in the except. It might look like this:
JavaScript
x
5
1
try:
2
# Your code here
3
except Exception as e:
4
traceback.print_exception(e)
5