Surprisingly, this doesn't come as a standard function in the Exception class.
import traceback
try:
raise Exception("print exception!")
except:
print traceback.format_exc()
Short and simple, so good!
Mainly notes to future-Twig (and for anyone else who may find them useful)
If you've found one or more of my blog posts helpful, why not say thanks by buying me a coffee or beer?
Surprisingly, this doesn't come as a standard function in the Exception class.
import traceback
try:
raise Exception("print exception!")
except:
print traceback.format_exc()
Short and simple, so good!