@@ -278,12 +278,63 @@ async def _run_activity(
278
278
# We choose to surround interceptor creation and activity invocation in
279
279
# a try block so we can mark the workflow as failed on any error instead
280
280
# of having error handling in the interceptor
281
+
282
+ # message ActivityTaskCompletion {
283
+ # bytes task_token = 1;
284
+ # activity_result.ActivityExecutionResult result = 2;
285
+ # }
286
+ # message ActivityExecutionResult {
287
+ # oneof status {
288
+ # Success completed = 1;
289
+ # Failure failed = 2;
290
+ # Cancellation cancelled = 3;
291
+ # WillCompleteAsync will_complete_async = 4;
292
+ # }
293
+ # }
294
+
281
295
completion = temporalio .bridge .proto .ActivityTaskCompletion (
282
296
task_token = task_token
283
297
)
284
298
try :
285
299
await self ._execute_activity (start , running_activity , completion )
286
300
except BaseException as err :
301
+ # temporal/api/failure/v1/
302
+ # message Failure {
303
+ # string message = 1;
304
+ # // The source this Failure originated in, e.g. TypeScriptSDK / JavaSDK
305
+ # // In some SDKs this is used to rehydrate the stack trace into an exception object.
306
+ # string source = 2;
307
+ # string stack_trace = 3;
308
+ # // Alternative way to supply `message` and `stack_trace` and possibly other attributes, used for encryption of
309
+ # // errors originating in user code which might contain sensitive information.
310
+ # // The `encoded_attributes` Payload could represent any serializable object, e.g. JSON object or a `Failure` proto
311
+ # // message.
312
+ # //
313
+ # // SDK authors:
314
+ # // - The SDK should provide a default `encodeFailureAttributes` and `decodeFailureAttributes` implementation that:
315
+ # // - Uses a JSON object to represent `{ message, stack_trace }`.
316
+ # // - Overwrites the original message with "Encoded failure" to indicate that more information could be extracted.
317
+ # // - Overwrites the original stack_trace with an empty string.
318
+ # // - The resulting JSON object is converted to Payload using the default PayloadConverter and should be processed
319
+ # // by the user-provided PayloadCodec
320
+ # //
321
+ # // - If there's demand, we could allow overriding the default SDK implementation to encode other opaque Failure attributes.
322
+ # // (-- api-linter: core::0203::optional=disabled --)
323
+ # temporal.api.common.v1.Payload encoded_attributes = 20;
324
+ # Failure cause = 4;
325
+ # oneof failure_info {
326
+ # ApplicationFailureInfo application_failure_info = 5;
327
+ # TimeoutFailureInfo timeout_failure_info = 6;
328
+ # CanceledFailureInfo canceled_failure_info = 7;
329
+ # TerminatedFailureInfo terminated_failure_info = 8;
330
+ # ServerFailureInfo server_failure_info = 9;
331
+ # ResetWorkflowFailureInfo reset_workflow_failure_info = 10;
332
+ # ActivityFailureInfo activity_failure_info = 11;
333
+ # ChildWorkflowExecutionFailureInfo child_workflow_execution_failure_info = 12;
334
+ # NexusOperationFailureInfo nexus_operation_execution_failure_info = 13;
335
+ # NexusHandlerFailureInfo nexus_handler_failure_info = 14;
336
+ # }
337
+ # }
287
338
try :
288
339
if isinstance (err , temporalio .activity ._CompleteAsyncError ):
289
340
temporalio .activity .logger .debug ("Completing asynchronously" )
0 commit comments