Get more information about Exception

try:
    some code
except Exception as e:
    exc_type, exc_obj, exc_tb = sys.exc_info()
    fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
    print(exc_type, exc_obj, fname, exc_tb.tb_lineno)

Last updated