[Xapian-discuss] PHP Fatal error while indexing Wikipedia

Olly Betts olly at survex.com
Wed Jan 9 02:16:49 GMT 2008


On Thu, Jan 03, 2008 at 12:12:38AM +0000, Olly Betts wrote:
> 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!)

I've now filed a bug against SWIG for this so the idea doesn't get lost:

http://sf.net/tracker/?func=detail&aid=1867350&group_id=1645&atid=101645

Cheers,
    Olly



More information about the Xapian-discuss mailing list