better error message for bad search strings

Bug #318880 reported by brettatoms
2
Affects Status Importance Assigned to Milestone
Bauble
Triaged
Medium
Unassigned

Bug Description

Should provide more information on bad searches. For example the search string, "species where accession.plants.code = 2009" give the following error:
** Error: type object 'Species' has no attribute 'key'

and the following traceback on the console:

view.py(810): Traceback (most recent call last):
  File "./bauble/view.py", line 806, in search
    results.add(strategy.search(text, self.session))
  File "./bauble/view.py", line 527, in search
    results.add(self._get_results_from_query(tokens, session))
  File "./bauble/view.py", line 428, in _get_results_from_query
    resolved = self._resolve_identifiers(mapping, idents)
  File "./bauble/view.py", line 385, in _resolve_identifiers
    props.append(get_prop(parent, identifiers[0]))
  File "./bauble/view.py", line 365, in get_prop
    parent_name = parent.key
AttributeError: type object 'Species' has no attribute 'key'

brettatoms (brettatoms)
Changed in bauble:
importance: Undecided → Medium
milestone: none → 0.9.0
status: New → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.