for name in module.__dict__:
    if issubclass(module.__dict__[name], Exception) or name.endswith('Error'):
        exns.append(name)
for name in exns:
    print('%s.%s is an exception type' % (str(mod), name))
return
How Can I Find a List of All Exceptions That a Given Library Function Throws in Python?