Exceptions

Roland Hedberg roland.hedberg at adm.umu.se
Fri Oct 27 17:23:46 CEST 2006


Hi!

If you encounter a problem the raises the exception, for instance
TYPE_OR_VALUE_EXISTS, and then prints the exception info, it will come
out looking something like this:

{'info': 'street: value #0 provided more than once', 'desc': 'Type or
value exists'}

Which looks like when you print a dictionary.
So, is that how it's done?
And if so, is there a way by which I can get at the individual pieces ?

The obvious:

try:
	....
except ldap.TYPE_OR_VALUE_EXISTS, e:
	print e.info

doesn't work

-- Roland




More information about the python-ldap mailing list