Changeset 7829


Ignore:
Timestamp:
Apr 8, 2010, 11:36:20 AM (7 years ago)
Author:
Álvaro Iradier
Message:

Version 0.7: better management of search errors

Location:
searchallplugin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • searchallplugin/setup.py

    r6039 r7829  
    22
    33PACKAGE = 'tracsearchall'
    4 VERSION = '0.6'
     4VERSION = '0.7'
    55
    66setup(name=PACKAGE,
  • searchallplugin/tracsearchall/searchall.py

    r7513 r7829  
    1616from trac.env import open_environment
    1717from trac.util import Markup
     18from trac.util.datefmt import to_datetime
    1819
    1920import re
     
    133134            self.env.log.debug("Searching for %s" % query[0] )           
    134135            self.env.log.debug("Searching with filters %s" % subfilters )
    135            
     136
    136137            #Update request data
    137138            orig_href = req.href
     
    139140           
    140141            for source in env_search.search_sources:
    141                 results += list(source.get_search_results(req, query, subfilters))
     142                for filter in subfilters:
     143                    try:
     144                        results += list(source.get_search_results(req, query, [filter]))
     145                    except Exception, ex:
     146                        results += [(req.href('search', **req.args),
     147                            "<strong>ERROR</strong> in search filter <em>%s</em>" % filter,
     148                            to_datetime(None), "none", "Exception: %s" % str(ex)),]
    142149           
    143150            req.href = orig_href
Note: See TracChangeset for help on using the changeset viewer.