Home made exception hierarcy - 2
examples/exceptions/hierarchy2.py
import colors as cl def main(): print("start") try: cl.green() except cl.MyGreenError as err: print(err) print(type(err).__name__) print("done") main()
start Hulk MyGreenError done
import colors as cl def main(): print("start") try: cl.green() except cl.MyGreenError as err: print(err) print(type(err).__name__) print("done") main()
start Hulk MyGreenError done