import traceback
def ToTraceLines(ex,
ex_traceback=None):
if
ex_traceback is None:
ex_traceback = ex.__traceback__
return [ line.rstrip('\n') for line in traceback.format_exception(ex.__class__, ex, ex_traceback)]
try:
x = get_number()
except Exception as ex:
ToTraceLines(ex)
沒有留言:
張貼留言