Since the exception happens in a thread, not the main process, use print_traceback to print the traceback.