[Xapian-discuss] Why is a "DocNotFoundError" when deleting a document a Fatal error in php?

Arjen van der Meijden acmmailing at tweakers.net
Fri Oct 28 09:56:59 BST 2005


Arjen van der Meijden wrote:
> James Aylett wrote:
>> On Fri, Oct 28, 2005 at 09:54:44AM +0200, Arjen van der Meijden wrote:
> 
> DocNotFoundError is a Xapian::RuntimeError afaics and thus wrapped to 
> SWIG_RuntimeError. Which appearantly yields E_ERROR in php and can thus 
> not be caught in any way.
> I just tested a user defined error handler, and that didn't work either.

This code won't help much for this:

 From line 45 of swig 1.3.27's Lib/exception.i:

#ifdef SWIGPHP4
%{
/* We should make use of "code" if we can */
#define SWIG_exception(code, msg) { zend_error(E_ERROR, msg); }
%}
#endif

So if Xapian::RuntimeError should not be fatal in php (which I think it 
shouldn't), it probably needs to be adjusted to do something like 
zend_error(E_WARNING, someMessage); instead of Swig's own exception 
handler (or the swig-handler should be reworked to have RuntimeErrors 
not be fatal).

Best regards,

Arjen



More information about the Xapian-discuss mailing list