I have some code where i'm trying to catch an exception and stifle it, but no matter what I do the code never prints the statement in the except block.
def check_configuration(cls, **kwargs):
print 'product_config'
errors = {}
for arg in kwargs:
if arg in cls.get_fields():
print 'found', arg
try:
getattr(cls, 'clean_'+arg)
except:
print 'missing validation method: clean_'+attr+'()'
'missing validation method: clean_la()' never prints!
I have tried
except Exception:
except AttributeError:
they don't work either, I'm confused is there something I'm missing with exceptions?