marcus-g
5/17/2017 - 5:08 AM

How to raise your own exception if for example a condition isn't met. Use raise. From https://docs.python.org/2/tutorial/errors.html

How to raise your own exception if for example a condition isn't met. Use raise.

From https://docs.python.org/2/tutorial/errors.html

>>> raise NameError('HiThere')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: HiThere