[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:49:35 BST 2005
James Aylett wrote:
> On Fri, Oct 28, 2005 at 09:54:44AM +0200, Arjen van der Meijden wrote:
>
> Common-ish - PHP is full of extensions that do strange things. I agree
> that it shouldn't be fatal, but rather a warning (so it can be @-ed
> out of existence in PHP's weird world). I note that
> DocNotFoundException isn't mentioned in the bindings, however - we're
> getting default behaviour, so it may be something that needs playing
> with in SWIG. (Or is there a SWIG non-fatal equivalent of
> SWIG_exception?)
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.
> I can't see why PHP5 shouldn't get this right, though. I'd expect
> SWIG_exception to throw a PHP5 exception, although perhaps that needs
> work in SWIG to do the right thing.
I haven't tested it, if a E_ERROR is sent to php in 5 as well, you won't
be able to use it. If indeed an exception is sent, it will work.
Best regards,
Arjen
More information about the Xapian-discuss
mailing list