mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 11:14:02 +02:00
Nicer error message when search query string is too long
This commit is contained in:
parent
32944ef443
commit
ace82b046f
1 changed files with 4 additions and 1 deletions
|
|
@ -212,7 +212,10 @@ def parse(self, query):
|
|||
# another search.
|
||||
def _parse(self, query, candidates=None):
|
||||
self.recurse_level += 1
|
||||
res = self._parser.parseString(query)[0]
|
||||
try:
|
||||
res = self._parser.parseString(query)[0]
|
||||
except RuntimeError:
|
||||
raise ParseException('Failed to parse query, recursion limit reached: %r'%query)
|
||||
if candidates is None:
|
||||
candidates = self.universal_set()
|
||||
t = self.evaluate(res, candidates)
|
||||
|
|
|
|||
Loading…
Reference in a new issue