Skip to content

Commit d7bb01b

Browse files
authored
Add ApplicationErrorCategory to ApplicationFailureInfo (#570)
<!-- Describe what has changed in this PR --> **What changed?** Added an ENUM `ApplicationErrorCategory`, used in `ApplicationFailureInfo` proto. <!-- Tell your future self why have you made these changes --> **Why?** Give users a way to categorize application failures. Error categories map to different observability behaviours SDK-side (i.e. logging/metrics), part of the work for benign exceptions. Categories could also be used with rules in the future. <!-- Are there any breaking changes on binary or code level? --> **Breaking changes** No <!-- If this breaks the Server, please provide the Server PR to merge right after this PR was merged. --> **Server PR** Don't believe this breaks server or requires any changes to server
1 parent c20a039 commit d7bb01b

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

Diff for: openapi/openapiv2.json

+12
Original file line numberDiff line numberDiff line change
@@ -8570,6 +8570,15 @@
85708570
},
85718571
"description": "Alert contains notification and severity."
85728572
},
8573+
"v1ApplicationErrorCategory": {
8574+
"type": "string",
8575+
"enum": [
8576+
"APPLICATION_ERROR_CATEGORY_UNSPECIFIED",
8577+
"APPLICATION_ERROR_CATEGORY_BENIGN"
8578+
],
8579+
"default": "APPLICATION_ERROR_CATEGORY_UNSPECIFIED",
8580+
"description": " - APPLICATION_ERROR_CATEGORY_BENIGN: Expected application error with little/no severity."
8581+
},
85738582
"v1ApplicationFailureInfo": {
85748583
"type": "object",
85758584
"properties": {
@@ -8585,6 +8594,9 @@
85858594
"nextRetryDelay": {
85868595
"type": "string",
85878596
"description": "next_retry_delay can be used by the client to override the activity\nretry interval calculated by the retry policy. Retry attempts will\nstill be subject to the maximum retries limit and total time limit\ndefined by the policy."
8597+
},
8598+
"category": {
8599+
"$ref": "#/definitions/v1ApplicationErrorCategory"
85888600
}
85898601
}
85908602
},

Diff for: openapi/openapiv3.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -6189,6 +6189,12 @@ components:
61896189
retry interval calculated by the retry policy. Retry attempts will
61906190
still be subject to the maximum retries limit and total time limit
61916191
defined by the policy.
6192+
category:
6193+
enum:
6194+
- APPLICATION_ERROR_CATEGORY_UNSPECIFIED
6195+
- APPLICATION_ERROR_CATEGORY_BENIGN
6196+
type: string
6197+
format: enum
61926198
BackfillRequest:
61936199
type: object
61946200
properties:

Diff for: temporal/api/enums/v1/common.proto

+6
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,10 @@ enum WorkflowRuleActionScope {
112112
WORKFLOW_RULE_ACTION_SCOPE_WORKFLOW = 1;
113113
// The action will be applied to a specific activity.
114114
WORKFLOW_RULE_ACTION_SCOPE_ACTIVITY = 2;
115+
}
116+
117+
enum ApplicationErrorCategory {
118+
APPLICATION_ERROR_CATEGORY_UNSPECIFIED = 0;
119+
// Expected application error with little/no severity.
120+
APPLICATION_ERROR_CATEGORY_BENIGN = 1;
115121
}

Diff for: temporal/api/failure/v1/message.proto

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ option csharp_namespace = "Temporalio.Api.Failure.V1";
3434
import "temporal/api/common/v1/message.proto";
3535
import "temporal/api/enums/v1/workflow.proto";
3636
import "temporal/api/enums/v1/nexus.proto";
37+
import "temporal/api/enums/v1/common.proto";
3738

3839
import "google/protobuf/duration.proto";
3940

@@ -46,6 +47,7 @@ message ApplicationFailureInfo {
4647
// still be subject to the maximum retries limit and total time limit
4748
// defined by the policy.
4849
google.protobuf.Duration next_retry_delay = 4;
50+
temporal.api.enums.v1.ApplicationErrorCategory category = 5;
4951
}
5052

5153
message TimeoutFailureInfo {

0 commit comments

Comments
 (0)