On Wed, September 7, 2005 2:34 am, Marc Chantreux wrote: > Graham Barr a écrit : > >> You cannot get the final response code from a search until all entries >> have been read because the code is in the final response packet. But >> the callback is called as each entry arrives. > > so is there a way to handle an error when it occurs ? i'm trying to fix > the AD bug and it would be good to toogle debug mode et the good entry.
Sure. But you only get one ststus code for the whole search, not per entry. The callback is called per-entry. So you need to check the code on the object returned from the search method, not in the callback. Graham. > >> It is not a bug, but a limitation if you want to process entries as >> they are returned from the server as they arrive. >> >> In the past I have been tempted to have ->sync fail if called from >> within a callback to prevent this situation. Either way you get an >> error, just this way it is more dramatic and causes people to fix thier >> code. > > i understand now. thanks for help, Graham. > > regards > mc > >