Francis Irving
2004-May-27 15:48 UTC
[Xapian-discuss] Bug in error handling for QueryParser in PHP
A bug report, when queryparser handles a bad string. I think the stuff Olly was doing to catch more exceptions might solve this? I'm not sure if errors can be caught in PHP though, or if queryparser will need to return false. Searching for: "foo" -- with double quotes is okay. "foo -- missing the last quote gives: Fatal error: unknown error in Xapian in /usr/data/vhost/beta.theyworkforyou.com/cvs/fawkes/www/includes/easyparliament/hansardlist.php on line 1018 Week after next I'll actually be able to show you all (not just Olly, thanks Olly!) the website we're working on... Francis -- Undemocratic Europe. Fix it. Vote Martin Bell. http://www.bellforeurope.org.uk
Olly Betts
2004-May-27 16:22 UTC
[Xapian-discuss] Bug in error handling for QueryParser in PHP
On Thu, May 27, 2004 at 04:48:19PM +0100, Francis Irving wrote:> A bug report, when queryparser handles a bad string. I think the > stuff Olly was doing to catch more exceptions might solve this?Actually, no. It's related though.> I'm not sure if errors can be caught in PHP though, or if queryparser > will need to return false.Currently queryparser throws "const char *" (no, really) if the query won't parse. This is wrong (it dates back to when it was an integral part of omega - it just never got changed to do something more sane). As you suggest, returning false would be better. Plus a method to read the error message.> Searching for: "foo" -- with double quotes is okay. "foo -- missing > the last quote gives: Fatal error: unknown error in Xapian in > [...]The CVS HEAD will handle this better, but only because it'll try stripping punctuation from a "bad" query, then reparsing. Cheers, Olly