Feb-14-2020, 02:39 AM
try/except is the proper way to go, example:
However, never leave errors in code you plan to release.
import sys try: print('2'+2) except TypeError: print(f"Caught a TypeError exception") sys.exit(0)I added an exit, but you can remove it if you want to analyse the code further.
However, never leave errors in code you plan to release.