<filename>exp/exception_handling_dynamic_creation.py
a = type('a_fyerr', (Exception,), {})

try:
	raise a('aa')

except Exception as e:
	print(type(e))
<filename>exp/exception_handling_dynamic_creation.py
a = type('a_fyerr', (Exception,), {})

try:
	raise a('aa')

except Exception as e:
	print(type(e))