From: Cere Davis Date: 2003-07-16T14:25:30+09:00 Subject: ldap with ruby confusion I have this piece of code that I modified based on search.rb in the ldap package for Ruby. Something isn't working correctly with this code but I cannot find a way to get the code to jsut printt regular ldap output instead of only printing hashes or error messages when an exception is caught. Does anyone know of a way that I can get just regular output that is similair to just using the ldapsearch utility? 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 # numResponses: 1 A readable error... Does anyone know how I would get this sort of readable error in Ruby with the ldap package? require 'ldap' HOST="directory.washington.edu" BASE="ou=People, o=University, c=US" LDAP::Conn.new(HOST, LDAP::LDAP_PORT).bind{|conn| conn.perror("bind") begin conn.search(BASE, LDAP::LDAP_SCOPE_SUBTREE, "(objectclass=*)" ){|e| p e.keys } rescue LDAP::ResultError => msg $stderr.print(msg) end } Thanks, Cere