From: Kurt D. Z. <Ku...@Op...> - 2002-06-05 15:01:12
|
My thoughts on this is that there should be a clear distinction between API error information and protocol result information returned by the server. The call's return should indicate API success or failure. Result codes should be handled separately. Overloading, as done in the LDAP C API, is a bad thing. Kurt At 07:50 AM 2002-06-05, Graham Barr wrote: >On Wed, Jun 05, 2002 at 12:16:21PM +0100, Graham Barr wrote: >> On Wed, Jun 05, 2002 at 03:55:31AM -0700, Murugan K G wrote: >> > Hi Chris >> > Thanks for your immediate response. >> > I am binding with LDAP3 only as >> > $ldap->bind('admin',password => 'novell', version=>3) >> > or die "Not able to bind"; >> >> bind, like most Net::LDAP methods, will always return true. You need to check >> the ->code method of the object returned. > >Does anyone else think that this is such a common problem that we >should try to deal with it ? > >We could deal with it by using overload on the message object, such >that on a boolean context it determines if there was an error. > >Of course, you then have the issue of how does the library determine >when a result is an error. > >Well my thought is that we could allow the user to pass a list >of acceptable result codes. By default LDAP_SUCCESS would always >be an acceptable result code, and compare would allow the TRUE/FALSE >result codes. > >We could even make it honor the onerror argument passed to new > >Graham. > >PS: I have thought about this before and still have an old patch >somewhere that will do this. > > >_______________________________________________________________ > >Don't miss the 2002 Sprint PCS Application Developer's Conference >August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm |