J
Joan Miller
Which is the best way to create user-defined exceptions since that
*BaseException.message* is deprecated in Python 2.6 ?
*BaseException.message* is deprecated in Python 2.6 ?
Which is the best way to create user-defined exceptions since that
*BaseException.message* is deprecated in Python 2.6 ?
It's enought, thanks!Inherit from an existing exception.
... pass
...
Traceback (most recent call last):
... pass
...>>> raise GenericError("oops")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
__main__.GenericError: oops
Do you need anything more complicated?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.