[Xapian-discuss] PHP Fatal error while indexing Wikipedia

Olly Betts olly at survex.com
Thu Jan 3 00:12:38 GMT 2008

On Wed, Jan 02, 2008 at 08:04:36AM +0000, Robert Young wrote:
> I was going to ask actually, is it possible to configure SWIG to throw
> exceptions rather than fatal errors in PHP5+? The main problem is that
> PHP fatal errors cannot be caught and cannot even be handled by custom
> error handling so they're very difficult to debug.

We already throw PHP exceptions for Xapian exceptions for PHP5, so it's
certainly possible to implement.

SWIG doesn't currently directly support throwing exceptions for errors
like "incorrect parameters".  The best (and perhaps only) way to
implement this would be to modify SWIG.  Perhaps it should always throw
exceptions for such cases rather than it being an option.

I doubt I'll have time to look at this for a while, but if someone comes
up with a suitable patch for SWIG, I can apply it (since I moonlight as
SWIG's PHP maintainer!)


More information about the Xapian-discuss mailing list