• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

allura


Commit MetaInfo

Revisión0d32feed52197ee657f68531865de5e291c6d2be (tree)
Tiempo2011-04-29 00:34:05
AutorDave Brondsema <dbrondsema@geek...>
CommiterWolf

Log Message

[#2019] latest pysolr parses the message for us, and logs errors

Signed-off-by: Dave Brondsema <dbrondsema@geek.net>

Cambiar Resumen

Diferencia incremental

--- a/Allura/allura/lib/search.py
+++ b/Allura/allura/lib/search.py
@@ -11,11 +11,6 @@ import pysolr
1111 from . import helpers as h
1212 from .markdown_extensions import ForgeExtension
1313
14-# from allura.tasks.search import AddArtifacts, DelArtifacts
15-
16-# re_SHORTLINK = re.compile(ForgeExtension.core_artifact_link)
17-re_SOLR_ERROR = re.compile(r'<pre>(org.apache.lucene[^:]+: )?(?P<text>[^<]+)</pre>')
18-
1914 log = getLogger(__name__)
2015
2116 def try_solr(func):
@@ -63,13 +58,7 @@ def search_artifact(atype, q, history=False, rows=10, **kw):
6358 try:
6459 return g.solr.search(q, fq=fq, rows=rows, **kw)
6560 except pysolr.SolrError, e:
66- log.info("Solr error: %s", e)
67- m = re_SOLR_ERROR.search(e.message)
68- if m:
69- text = m.group('text')
70- else:
71- text = "syntax error?"
72- raise ValueError(text)
61+ raise ValueError('Error running search query: %s' % e.message)
7362
7463 def find_shortlinks(text):
7564 md = markdown.Markdown(
@@ -78,4 +67,3 @@ def find_shortlinks(text):
7867 md.convert(text)
7968 link_index = md.postprocessors['forge'].parent.alinks
8069 return [ link for link in link_index.itervalues() if link is not None]
81-