s4/ldb: error string handling

Jelmer Vernooij jelmer at samba.org
Wed Sep 21 11:06:26 MDT 2011


Hi Matthias,

On 09/21/2011 07:00 PM, Matthias Dieter Wallnöfer wrote:
> Hi Andrew,
>
> always related to my extended operations work I'm noticing the fact 
> that we are setting generic error strings on failures (if no one 
> already exists) in quite some different places (py_ldb_add(), 
> py_ldb_modify(), ..., ldb_autotransaction_request()). Hence this 
> handling has to be duplicated when I'm implementing py_ldb_extended() 
> and so on. Anyway I have my doubts if this enumeration is or will 
> remain complete and intact.
>
> After a talk to Jelmer which thinks that an error string is always 
> good to have my proposal is to move this handling into ldb_request() 
> and ldb_wait(). I would be very glad if you could have a look at the 
> patches in my "pre_exop" branch beside the last one (ldb:pyldb.c - 
> implementation of extended request handling) which is WIP.
A clarification: I've said we should either rely on ldb always setting 
ldb_errstring() in case of errors (and an available context to set it 
on) /or/ PyErr_SetLdbError should take care of falling back to 
ldb_strerror() rather than every function doing this own its own.

Cheers,

Jelmer


More information about the samba-technical mailing list