[Tutor] Checking for custom error codes
alan.gauld at btinternet.com
Tue Aug 7 19:25:51 CEST 2007
"wormwood_3" <wormwood_3 at yahoo.com> wrote
> Recently I was trying to do a "try: X except Y: Z" statement,
> checking for a custom error code
> for potdomain in self.potdomains:
> except 'NoSuchDomain':
> got a warning that throwing a string exception is deprecated,
> but the check did not work anyway.
So what did happen? Your code simply ignores the error so, for it not
to work, I assume you are still getting an error report and traceback?
If so what does it say?
Python error messages may look arcane to start with but they usually
contain enough information to identify a problem without any further
debugging - but only if we can see them! :-)
Author of the Learn to Program web site
More information about the Tutor