Skip to content

Commit 86427ee

Browse files
authored
[DT-147] Add new workflow task failed error copy (#965)
* Remove Cause from title * Update existing error copy * Add new errors * Add support link * Add WorkflowTaskHeartbeatError * Capitalize Failure Message
1 parent ba6a9b1 commit 86427ee

File tree

1 file changed

+91
-15
lines changed

1 file changed

+91
-15
lines changed

Diff for: src/lib/components/workflow/workflow-typed-error.svelte

+91-15
Original file line numberDiff line numberDiff line change
@@ -7,103 +7,179 @@
77
import EventSummaryRow from '$lib/components/event/event-summary-row.svelte';
88
99
const WORKFLOW_TASK_FAILED_ERROR_COPY = {
10+
Unspecified: {
11+
title: 'Unspecified',
12+
copy: 'The Workflow Task failed for an unknown reason.',
13+
contactSupport: true,
14+
},
1015
UnhandledCommand: {
1116
title: 'Unhandled Command',
12-
copy: 'The workflow task has failed because there are new available events since the last workflow task started. A retry workflow task has been scheduled and the workflow will have a chance to handle those new events.',
17+
copy: 'The Workflow Task failed because there are new available events since the last Workflow Task started. A retry Workflow Task has been scheduled and the Workflow will have a chance to handle those new events.',
1318
},
1419
BadScheduleActivityAttributes: {
1520
title: 'Bad Schedule Activity Attributes',
21+
copy: 'The Workflow Task failed because of missing or incorrect ScheduleActivity attributes.',
1622
},
1723
BadRequestCancelActivityAttributes: {
1824
title: 'Bad Request Cancel Activity Attributes',
25+
copy: 'The Workflow Task failed because of bad RequestCancelActivity attributes. An Activity was scheduled to cancel, but the scheduled event id was never set.',
1926
},
2027
BadStartTimerAttributes: {
2128
title: 'Bad Start Timer Attributes',
29+
copy: 'The Workflow Task failed because the scheduled event is missing a timer id.',
2230
},
2331
BadCancelTimerAttributes: {
2432
title: 'Bad Cancel Timer Attributes',
33+
copy: 'The Workflow Task failed when trying to cancel a timer due to an unset timer id.',
2534
},
2635
BadRecordMarkerAttributes: {
2736
title: 'Bad Record Marker Attributes',
37+
copy: 'The Workflow Task failed because of a missing or invalid Marker name.',
2838
},
2939
BadCompleteWorkflowExecutionAttributes: {
3040
title: 'Bad Complete Workflow Execution Attributes',
41+
copy: 'The Workflow Task failed because of an unset attribute on CompleteWorkflowExecution.',
3142
},
3243
BadFailWorkflowExecutionAttribute: {
3344
title: 'Bad Fail Workflow Execution Attributes',
45+
copy: 'The Workflow Task failed because of an unset FailWorkflowExecution attribute or failure.',
3446
},
3547
BadCancelWorkflowExecutionAttributes: {
3648
title: 'Bad Cancel Workflow Execution Attributes',
49+
copy: 'The Workflow Task failed because of an unset attribute on CancelWorkflowExecution.',
3750
},
3851
BadRequestCancelExternalAttributes: {
3952
title: 'Bad Request Cancel External Attributes',
53+
copy: 'The Workflow Task failed due to an invalid attribute on a request to cancel an external Workflow. Check the Failure Message for more details.',
4054
},
4155
BadContinueAsNewAttributes: {
4256
title: 'Bad Continue As New Attributes',
57+
copy: 'The Workflow Task failed because it failed to validate on a ContinueAsNew attribute. Check the Failure Message for more details.',
4358
},
4459
StartTimerDuplicateId: {
4560
title: 'Start Timer Duplicate',
61+
copy: 'The Workflow Task failed because a timer with the given timer id has already started.',
4662
},
4763
ResetStickyTaskQueue: {
4864
title: 'Reset Sticky Task Queue',
65+
copy: 'The Workflow Task failed because the Sticky Task Queue needs to be reset. The system will automatically retry.',
4966
},
5067
WorkflowWorkerUnhandledFailure: {
5168
title: 'Workflow Worker Unhandled Failure',
52-
copy: 'The workflow task has failed due to an unhandled failure from the workflow code.',
69+
copy: 'The Workflow Task failed due to an unhandled failure from the Workflow code.',
5370
actionCopy: 'deterministic constraints',
5471
link: 'https://docs.temporal.io/workflows/#deterministic-constraints',
5572
},
73+
WorkflowTaskHeartbeatError: {
74+
title: 'Workflow Task Heartbeat Error',
75+
copy: 'The Workflow Task failed to send a heartbeat while executing long-running local Activities. These local Activities will re-execute on the next Workflow Task attempt. If this error is persistent, these local Activities will run repeatedly until the Workflow times out.',
76+
},
5677
BadSignalWorkflowExecutionAttributes: {
5778
title: 'Bad Signal Workflow Execution Attributes',
79+
copy: 'The Workflow Task failed to validate attributes for SignalWorkflowExecution. Check the Failure Message for more details.',
5880
},
5981
BadStartChildExecutionAttributes: {
6082
title: 'Bad Start Child Execution Attributes',
83+
copy: 'The Workflow Task failed to validate attributes needed for StartChildWorkflowExecution. Check the Failure Message for more details.',
6184
},
6285
ForceCloseCommand: {
6386
title: 'Force Close Command',
64-
copy: 'The workflow task was forced to close by the server. A retry will be scheduled if this is a recoverable error.',
87+
copy: 'The Workflow Task was forced to close. A retry will be scheduled if the error is recoverable.',
6588
},
6689
FailoverCloseCommand: {
6790
title: 'Failover Close Command',
68-
copy: 'The workflow task was forced to close due to a namespace failover. A retry will be scheduled automatically.',
91+
copy: 'The Workflow Task was forced to close due to a Namespace failover. A retry will be scheduled automatically.',
6992
},
7093
BadSignalInputSize: {
7194
title: 'Bad Signal Input Size',
95+
copy: 'The payload has exceeded the available input size on a Signal.',
7296
},
7397
ResetWorkflow: {
7498
title: 'Reset Workflow',
99+
copy: 'The system failed this Workflow Task. If a reset for this Workflow was requested check the progress on the new Workflow, otherwise reset this Workflow.',
75100
},
76101
BadBinary: {
77102
title: 'Bad Binary',
103+
copy: 'The system failed this Workflow Task because the deployment of this Worker is marked as bad binary.',
78104
},
79105
ScheduleActivityDuplicatId: {
80106
title: 'Schedule Activity Duplicate ID',
81-
copy: 'A duplicate Activity ID is used, please check if you have specified the same ActivityID in your workflow.',
107+
copy: 'The Workflow Task failed because the Activity ID is already in use, please check if you have specified the same Activity ID in your workflow.',
82108
},
83109
BadSearchAttributes: {
84-
title: 'Missing Search Attributes',
85-
copy: 'It looks like you might be missing search attributes, which might cause workflow tasks to continue to retry without success.',
110+
title: 'Bad Search Attributes',
111+
copy: 'A Search attribute is either missing or the value exceeds the limit. This might cause Workflow tasks to continue to retry without success.',
86112
actionCopy: 'configuring search attributes',
87113
link: 'https://docs.temporal.io/visibility#search-attribute',
88114
},
89115
NonDeterministicError: {
90-
title: 'Cause Non Deterministic Error',
91-
copy: 'The workflow task has failed due to non-deterministic error from workflow code. This usually means the workflow code has a non-backward compatible change without proper versioning branch.',
116+
title: 'Non Deterministic Error',
117+
copy: 'A non-deterministic error has caused the Workflow Task to fail. This usually means the workflow code has a non-backward compatible change without a proper versioning branch.',
118+
},
119+
BadModifyWorkflowPropertiesAttributes: {
120+
title: 'Bad Modify Workflow Properties Attributes',
121+
copy: 'The Workflow Task failed to validate attributes on ModifyWorkflowProperty on the upsert memo. Check the Failure Message for more details.',
122+
},
123+
PendingChildWorkflowsLimitExceeded: {
124+
title: 'Pending Child Workflows Limit Exceeded',
125+
copy: 'The capacity for pending child Workflows has been reached. The Workflow Task was failed to prevent any more child Workflows from being added.',
126+
},
127+
PendingActivitiesLimitExceeded: {
128+
title: 'Pending Activities Limit Exceeded',
129+
copy: 'The capacity for pending Activities has been reached. The Workflow Task was failed to prevent another Activity from being created.',
130+
},
131+
PendingSignalsLimitExceeded: {
132+
title: 'Pending Signals Limit Exceeded',
133+
copy: 'The capacity for pending Signals to be sent from this Workflow has been reached.',
134+
},
135+
PendingRequestCancelLimitExceeded: {
136+
title: 'Pending Request Cancel Limit Exceeded',
137+
copy: 'The capacity for pending requests to cancel other Workflows has been reached.',
92138
},
93139
};
94140
141+
function getErrorCause(
142+
error: WorkflowTaskFailedEvent,
143+
): WorkflowTaskFailedCause | 'WorkflowTaskHeartbeatError' {
144+
if (!error || !error.workflowTaskFailedEventAttributes) {
145+
return;
146+
}
147+
148+
const {
149+
workflowTaskFailedEventAttributes: { failure, cause },
150+
} = error;
151+
152+
if (
153+
failure?.applicationFailureInfo?.type === 'workflowTaskHeartbeatError'
154+
) {
155+
return 'WorkflowTaskHeartbeatError';
156+
}
157+
return cause;
158+
}
159+
95160
export let error: WorkflowTaskFailedEvent;
96161
97-
$: errorCopy =
98-
WORKFLOW_TASK_FAILED_ERROR_COPY[
99-
error?.workflowTaskFailedEventAttributes?.cause
100-
] ?? {};
101-
$: ({ title = '', copy = '', actionCopy = '', link = '' } = errorCopy);
162+
$: cause = getErrorCause(error);
163+
$: errorCopy = WORKFLOW_TASK_FAILED_ERROR_COPY[cause] ?? {};
164+
$: ({
165+
title = '',
166+
copy = '',
167+
actionCopy = '',
168+
link = '',
169+
contactSupport = false,
170+
} = errorCopy);
102171
</script>
103172

104173
{#if !$updating && (title || copy)}
105174
<Alert icon="warning" intent="warning" {title}>
106-
<p>{copy}</p>
175+
<p>
176+
{copy}
177+
{#if contactSupport}
178+
Please <Link newTab href="http://support.temporal.io/"
179+
>contact support</Link
180+
>.
181+
{/if}
182+
</p>
107183
{#if actionCopy && link}
108184
<p>
109185
Learn more about <Link newTab href={link}>{actionCopy}</Link>.

0 commit comments

Comments
 (0)