Skip to content

Commit

Permalink
Merge pull request #74 from StackStorm/catch-expr-eval-errors
Browse files Browse the repository at this point in the history
Handle expression functions returning other exception types
  • Loading branch information
m4dcoder authored Jun 28, 2018
2 parents 09be269 + 34bc678 commit 7d19799
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions orchestra/conducting.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def get_start_tasks(self):
for task_node in self.graph.roots:
try:
tasks.append(self.get_task(task_node['id']))
except exc.ExpressionEvaluationException as e:
except Exception as e:
self.log_error(str(e), task_id=task_node['id'])
self.set_workflow_state(states.FAILED)
continue
Expand All @@ -344,7 +344,7 @@ def get_next_tasks(self, task_id=None):
for staged_task_id in staged_tasks:
try:
next_tasks.append(self.get_task(staged_task_id))
except exc.ExpressionEvaluationException as e:
except Exception as e:
self.log_error(str(e), task_id=staged_task_id)
self.set_workflow_state(states.FAILED)
continue
Expand Down Expand Up @@ -376,7 +376,7 @@ def get_next_tasks(self, task_id=None):

try:
next_tasks.append(self.get_task(next_task_id))
except exc.ExpressionEvaluationException as e:
except Exception as e:
self.log_error(str(e), task_id=next_task_id)
self.set_workflow_state(states.FAILED)
continue
Expand Down Expand Up @@ -475,7 +475,7 @@ def update_task_flow(self, task_id, state, result=None):
criteria = task_transition[3].get('criteria') or []
evaluated_criteria = [expr.evaluate(c, current_ctx) for c in criteria]
task_flow_entry[task_transition_id] = all(evaluated_criteria)
except exc.ExpressionEvaluationException as e:
except Exception as e:
self.log_error(str(e), task_id, task_transition_id)
self.set_workflow_state(states.FAILED)
continue
Expand Down

0 comments on commit 7d19799

Please sign in to comment.