|
From: Donal H. <don...@ma...> - 2001-10-23 12:53:30
|
Nick,
try this:
-----------------------------------------------------------
try:
<connect, bind and search, as is currently shown>
except Exception, e:
print 'Error! %s' % e
-----------------------------------------------------------
Regards
Donal Hunt
Nick Bower wrote:
>
> Is there any possible way to tell what exception has been raised in
> python-ldap without catching every single possibile type of
> _ldap.LDAPError?
>
> It would be really nice in example included in the python-ldap
> documentation if an exception was caught in the following general way:
>
> try:
> <connect, bind and search, as is currently shown>
> except:
> <display type of exception and its description>
>
> at the moment, there is no example code with exceptions in the
> documentation or distribution and i can't figure out how to catch one
> from the exception references provided without trying to catch every
> single possibility.
>
> thanks alot, nick.
>
> _______________________________________________
> Python-LDAP-dev mailing list
> Pyt...@li...
> https://lists.sourceforge.net/lists/listinfo/python-ldap-dev
|