diff --git a/python/rcdb/provider.py b/python/rcdb/provider.py index a700bcb..b9b358f 100644 --- a/python/rcdb/provider.py +++ b/python/rcdb/provider.py @@ -788,8 +788,16 @@ def select_runs(self, search_str="", run_min=0, run_max=sys.maxsize, sort_desc=F if isinstance(value, Condition): value = (value,) run = value[0].run - if eval(compiled_search_eval): - sel_runs.append(run) + try: + if eval(compiled_search_eval): + sel_runs.append(run) + except Exception as ex: + message = 'Error evaluating search query.\n' \ + + ' Query: <<"{}">>, \n'.format(search_eval) \ + + ' Names: {}, \n'.format(names) \ + + ' Values: {} \n'.format(values) \ + + ' Error ({}): {}'.format(type(ex), ex) + raise QueryEvaluationError(msg=message) selection_sw.stop() result = RunSelectionResult(sel_runs, self) @@ -971,7 +979,7 @@ def select_values(self, val_names=None, search_str="", run_min=0, run_max=sys.ma + ' Query: <<"{}">>, \n'.format(search_eval) \ + ' Names: {}, \n'.format(names) \ + ' Values: {} \n'.format(values) \ - + ' Error: {}'.format(ex) + + ' Error ({}): {}'.format(type(ex), ex) raise QueryEvaluationError(msg=message) selection_sw.stop()