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