Skip to content

Instantly share code, notes, and snippets.

@YiLi225
Created November 15, 2022 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YiLi225/cf79e123a1ccca2d331fbdcfec1a0e23 to your computer and use it in GitHub Desktop.
Save YiLi225/cf79e123a1ccca2d331fbdcfec1a0e23 to your computer and use it in GitHub Desktop.
from datetime import datetime
try:
1/0
except Exception as myError:
myError.add_note(f'Hey, there is an error; \
Raised at {datetime.now()}')
raise
Output:
Traceback (most recent call last):
File "<stdin>", line 5, in <module>
ZeroDivisionError: division by zero
Hey, there is an error; Raised at 2022-11-15 21:20:06.218401
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment