[PATCH] Error out if no query is supplied to search instead of going into an infinite loop

classic Classic list List threaded Threaded
2 messages Options
Alexander Botero-Lowry Alexander Botero-Lowry
Reply | Threaded
Open this post in threaded view
|

[PATCH] Error out if no query is supplied to search instead of going into an infinite loop

In this case error out when no query is supplied. There seems to be an infinite-loop casued by i think notmuch_query_search_threads having
an exception:

A Xapian exception occurred: Syntax: <expression> AND <expression>
A Xapian exception occurred: Syntax: <expression> AND <expression>
A Xapian exception occurred: Syntax: <expression> AND <expression>
A Xapian exception occurred: Syntax: <expression> AND <expression>
A Xapian exception occurred: Syntax: <expression> AND <expression>
A Xapian exception occurred: Syntax: <expression> AND <expression>
A Xapian exception occurred: Syntax: <expression> AND <expression>
A Xapian exception occurred: Syntax: <expression> AND <expression>
A Xapian exception occurred: Syntax: <expression> AND <expression>
A Xapian exception occurred: Syntax: <expression> AND <expression>
A Xapian exception occurred: Syntax: <expression> AND <expression>
A Xapian exception occurred: Syntax: <expression> AND <expression>
A Xapian exception occurred: Syntax: <expression> AND <expression>
A Xapian exception occurred: Syntax: <expression> AND <expression>
A Xapian exception occurred: Syntax: <expression> AND <expression>

I'll look into that bug specifically a bit later.

It might be better to do a usage instead of just throwing an error here?

alex

0001-Error-out-if-no-query-is-supplied-to-search-instead-.patch (1K) Download Attachment
Carl Worth-2 Carl Worth-2
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Error out if no query is supplied to search instead of going into an infinite loop

On Tue, 17 Nov 2009 16:23:53 -0800, Alex Botero-Lowry <[hidden email]> wrote:

> In this case error out when no query is supplied. There seems to be an
> infinite-loop casued by i think notmuch_query_search_threads having
> an exception:
> A Xapian exception occurred: Syntax: <expression> AND <expression>
> A Xapian exception occurred: Syntax: <expression> AND <expression>
> A Xapian exception occurred: Syntax: <expression> AND <expression>
>
> I'll look into that bug specifically a bit later.
>
> It might be better to do a usage instead of just throwing an error here?

Definitely.

Priit Laes reported the same thing in IRC and I've just committed a
patch to give a nice error message:

$ ./notmuch search
Error: notmuch search requires at least one search term.

Thanks for the report!

-Carl