📜  python 获取异常消息 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:42.844000             🧑  作者: Mango

代码示例3
try:
  # do something
  pass
except:
  # this will print the message "An exception occurred and the traceback" 
  # you can't have to explicitly give the message
  logger.exception("An exception occurred")