On 12/05/2011 21:12, Andrew Berg wrote:
On 2011.05.12 02:25 PM, MRAB wrote:
You can raise an exception wherever you like! :-)
If I raise an exception that isn't a built-in exception, I get something
like "NameError: name 'HelloError' is not defined". I don't know how to
define the exception.

Define it as a subclass of Exception:

    class UnknownBirdError(Exception):
        pass
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to