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:
try:
    # Your code here
except Exception as e:
    traceback.print_exception(e)