Skip to content

Commit c3dcbd9

Browse files
vnalawad-tibcoFrank Martinez
authored and
Frank Martinez
committed
Error occurred in sub-flow fault handler not propagated back to main flow
1 parent 684bcfd commit c3dcbd9

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

instance/instances.go

+20-1
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,26 @@ func (inst *IndependentInstance) handleTaskError(taskBehavior model.TaskBehavior
410410
} else {
411411
if containerInst.isHandlingError {
412412
//fail
413-
inst.SetStatus(model.FlowStatusFailed)
413+
containerInst.SetStatus(model.FlowStatusFailed)
414+
415+
if containerInst != inst.Instance {
416+
// Complete Subflow trace
417+
if containerInst.tracingCtx != nil {
418+
_ = trace.GetTracer().FinishTrace(containerInst.tracingCtx, err)
419+
}
420+
421+
// spawned from task instance
422+
host, ok := containerInst.host.(*TaskInst)
423+
424+
if ok {
425+
behavior := inst.flowModel.GetDefaultTaskBehavior()
426+
if typeID := host.task.TypeID(); typeID != "" {
427+
behavior = inst.flowModel.GetTaskBehavior(typeID)
428+
}
429+
inst.handleTaskError(behavior, host, err)
430+
}
431+
}
432+
414433
} else {
415434
taskInst.appendErrorData(err)
416435
inst.HandleGlobalError(containerInst, err)

0 commit comments

Comments
 (0)