29
workflowTask *historyi.WorkflowTaskInfo,
30
workflowTaskFailureCause enumspb.WorkflowTaskFailedCause,
31
>
) (*historypb.HistoryEvent, error) {
util.go
32
>
33
>
// IMPORTANT: wtFailedEvent can be nil under some circumstances. Specifically, if WT is transient.
34
>
wtFailedEvent, err := mutableState.AddWorkflowTaskFailedEvent(
35
>
workflowTask,
36
>
workflowTaskFailureCause,
37
>
nil,
38
>
consts.IdentityHistoryService,
39
>
nil,
40
>
"",
41
>
"",
42
>
"",
43
>
0,
44
>
)
45
>
if err != nil {
46
return nil, err
47
}
48
49
>
mutableState.FlushBufferedEvents()
util.go
50
>
return wtFailedEvent, nil
51
}
52