summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsand <daniel@spatof.org>2013-05-16 17:59:33 (GMT)
committer sand <daniel@spatof.org>2013-05-16 17:59:33 (GMT)
commit69962d19d0ef1a1a0f6abc5088d68023088c0660 (patch)
treee8a53e5249d2ca3da36d77aed28646e9271a9917
parent0ec7cce5fb1cb59b9e459d42cf813152ba02907c (diff)
quotes: controllo errori per ricerca
-rw-r--r--pinolo/plugins/quotes2.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/pinolo/plugins/quotes2.py b/pinolo/plugins/quotes2.py
index fe252ac..e53b6e2 100644
--- a/pinolo/plugins/quotes2.py
+++ b/pinolo/plugins/quotes2.py
@@ -132,7 +132,12 @@ class QuotesPlugin(Plugin):
qp = QueryParser("quote", self.ix.schema)
query = qp.parse(event.text)
# results = searcher.search(query, limit=limit)
- results = searcher.search_page(query, page, pagelen=limit)
+ try:
+ results = searcher.search_page(query, page, pagelen=limit)
+ except ValueError:
+ event.reply(u"La tua ricerca mi ha inibito il cervello")
+ return
+
found = results.scored_length()
if not found:
event.reply(u"Non ho trovato un cazzo!")