Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion azure/durable_functions/models/OrchestratorState.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import json
from typing import List, Any, Dict, Optional, Union
from typing import List, Any, Dict, Optional

from azure.durable_functions.models.ReplaySchema import ReplaySchema

Expand Down
10 changes: 10 additions & 0 deletions azure/durable_functions/models/TaskOrchestrationExecutor.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,16 @@ def get_orchestrator_state_str(self) -> str:
message contains in it the string representation of the orchestration's
state
"""
if(self.output is not None):
try:
# Attempt to serialize the output. If serialization fails, raise an
# error indicating that the orchestration output is not serializable,
# which is not permitted in durable Python functions.
json.dumps(self.output)
except Exception as e:
self.output = None
self.exception = e

state = OrchestratorState(
is_done=self.orchestration_invocation_succeeded,
actions=self.context._actions,
Expand Down