Skip to content

Commit

Permalink
Handle expression functions returning other exception types
Browse files Browse the repository at this point in the history
Currently, only ExpressionEvaluationException are caught. There are cases when rendering task spec or evaluating task transition that the expression functions, task rendering step, or task transition evaluation step is returning other types of exception. The try blocks are modified to catch a more general exception type.
  • Loading branch information
m4dcoder committed Jun 28, 2018
1 parent 09be269 commit 34bc678
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 34bc678

Please sign in to comment.