From: Brian Candler Date: 2003-07-16T17:56:53+09:00 Subject: Re: ldap with ruby confusion On Wed, Jul 16, 2003 at 02:25:30PM +0900, Cere Davis wrote: > For example with ldapsearch -x -b 'ou=People, o=University of > Washington, c=US': > > I get: > version: 2 > > # > # filter: (objectclass=*) > # requesting: ALL > # > > # search result > search: 2 > result: 11 Administrative limit exceeded Yes, but what server are you sending that query to? (It will be whatever is in your ldap.conf). If I use the same server as your Ruby example, I get: $ ldapsearch -h directory.washington.edu -x -b 'ou=People, o=University of Washington, cs=US' version: 2 # # filter: (objectclass=*) # requesting: ALL # # search result search: 2 result: 32 No such object <<<<< # numResponses: 1 > Does anyone know how I would get this sort of readable error in Ruby > with the ldap package? Running your example ruby-ldap program, I get: bind: Success No such object <<<<< which is exactly the same as ldapsearch gives (except ldapsearch includes the machine-parsable response as well - code 32 #define LDAP_NO_SUCH_OBJECT 0x20 So maybe it would be better if there were an LDAP exception object, or different exceptions for each LDAP error, but apart from that it appears to be doing the Right Thing [TM]. You are correctly capturing that result using rescue. Cheers, Brian.