allura
Revisión | 0d32feed52197ee657f68531865de5e291c6d2be (tree) |
---|---|
Tiempo | 2011-04-29 00:34:05 |
Autor | Dave Brondsema <dbrondsema@geek...> |
Commiter | Wolf |
[#2019] latest pysolr parses the message for us, and logs errors
Signed-off-by: Dave Brondsema <dbrondsema@geek.net>
@@ -11,11 +11,6 @@ import pysolr | ||
11 | 11 | from . import helpers as h |
12 | 12 | from .markdown_extensions import ForgeExtension |
13 | 13 | |
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 | - | |
19 | 14 | log = getLogger(__name__) |
20 | 15 | |
21 | 16 | def try_solr(func): |
@@ -63,13 +58,7 @@ def search_artifact(atype, q, history=False, rows=10, **kw): | ||
63 | 58 | try: |
64 | 59 | return g.solr.search(q, fq=fq, rows=rows, **kw) |
65 | 60 | 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) | |
73 | 62 | |
74 | 63 | def find_shortlinks(text): |
75 | 64 | md = markdown.Markdown( |
@@ -78,4 +67,3 @@ def find_shortlinks(text): | ||
78 | 67 | md.convert(text) |
79 | 68 | link_index = md.postprocessors['forge'].parent.alinks |
80 | 69 | return [ link for link in link_index.itervalues() if link is not None] |
81 | - |