diff --git a/expected_workflows/flow_hybrid_expected.py b/expected_workflows/flow_hybrid_expected.py index a926278..36e2e2e 100644 --- a/expected_workflows/flow_hybrid_expected.py +++ b/expected_workflows/flow_hybrid_expected.py @@ -6,6 +6,7 @@ import json import datetime import re import jmespath +from temporalio.exceptions import ApplicationError # Configure logging logging.basicConfig(level=logging.INFO, @@ -88,7 +89,7 @@ class test_repo_test_branch_1234567890: block_error = { "code": type(e).__name__, "description": str(e), - "details": {} + "details": {"cause": str(getattr(e, "cause", "No additional details"))} } workflow_output["status"] = "failed" # Collect block output @@ -153,7 +154,7 @@ class test_repo_test_branch_1234567890: block_error = { "code": type(e).__name__, "description": str(e), - "details": {} + "details": {"cause": str(getattr(e, "cause", "No additional details"))} } workflow_output["status"] = "failed" # Collect block output @@ -218,7 +219,7 @@ class test_repo_test_branch_1234567890: block_error = { "code": type(e).__name__, "description": str(e), - "details": {} + "details": {"cause": str(getattr(e, "cause", "No additional details"))} } workflow_output["status"] = "failed" # Collect block output @@ -252,10 +253,12 @@ class test_repo_test_branch_1234567890: # Update workflow status to completed if not failed if workflow_output["status"] != "failed": workflow_output["status"] = "completed" + else: + raise ApplicationError("Activity error occurred", type="ActivityError", non_retryable=True) return workflow_output except Exception as e: logger.error(f"Workflow failed with error: {e}") workflow_output["status"] = "failed" - raise \ No newline at end of file + raise temporalio.exceptions.ApplicationError("Workflow failed",workflow_output,str(e),type="WorkflowError",non_retryable=True) from e \ No newline at end of file diff --git a/expected_workflows/flow_parallel_expected.py b/expected_workflows/flow_parallel_expected.py index eee0ad6..2f7e008 100644 --- a/expected_workflows/flow_parallel_expected.py +++ b/expected_workflows/flow_parallel_expected.py @@ -6,6 +6,7 @@ import json import datetime import re import jmespath +from temporalio.exceptions import ApplicationError # Configure logging logging.basicConfig(level=logging.INFO, @@ -88,7 +89,7 @@ class test_repo_test_branch_1234567890: block_error = { "code": type(e).__name__, "description": str(e), - "details": {} + "details": {"cause": str(getattr(e, "cause", "No additional details"))} } workflow_output["status"] = "failed" # Collect block output @@ -152,7 +153,7 @@ class test_repo_test_branch_1234567890: block_error = { "code": type(e).__name__, "description": str(e), - "details": {} + "details": {"cause": str(getattr(e, "cause", "No additional details"))} } workflow_output["status"] = "failed" # Collect block output @@ -216,7 +217,7 @@ class test_repo_test_branch_1234567890: block_error = { "code": type(e).__name__, "description": str(e), - "details": {} + "details": {"cause": str(getattr(e, "cause", "No additional details"))} } workflow_output["status"] = "failed" # Collect block output @@ -243,10 +244,12 @@ class test_repo_test_branch_1234567890: # Update workflow status to completed if not failed if workflow_output["status"] != "failed": workflow_output["status"] = "completed" + else: + raise ApplicationError("Activity error occurred", type="ActivityError", non_retryable=True) return workflow_output except Exception as e: logger.error(f"Workflow failed with error: {e}") workflow_output["status"] = "failed" - raise \ No newline at end of file + raise temporalio.exceptions.ApplicationError("Workflow failed",workflow_output,str(e),type="WorkflowError",non_retryable=True) from e \ No newline at end of file diff --git a/expected_workflows/flow_sequential_expected.py b/expected_workflows/flow_sequential_expected.py index a9649bf..3559ece 100644 --- a/expected_workflows/flow_sequential_expected.py +++ b/expected_workflows/flow_sequential_expected.py @@ -6,6 +6,7 @@ import json import datetime import re import jmespath +from temporalio.exceptions import ApplicationError # Configure logging logging.basicConfig(level=logging.INFO, @@ -88,7 +89,7 @@ class test_repo_test_branch_1234567890: block_error = { "code": type(e).__name__, "description": str(e), - "details": {} + "details": {"cause": str(getattr(e, "cause", "No additional details"))} } workflow_output["status"] = "failed" # Collect block output @@ -153,7 +154,7 @@ class test_repo_test_branch_1234567890: block_error = { "code": type(e).__name__, "description": str(e), - "details": {} + "details": {"cause": str(getattr(e, "cause", "No additional details"))} } workflow_output["status"] = "failed" # Collect block output @@ -218,7 +219,7 @@ class test_repo_test_branch_1234567890: block_error = { "code": type(e).__name__, "description": str(e), - "details": {} + "details": {"cause": str(getattr(e, "cause", "No additional details"))} } workflow_output["status"] = "failed" # Collect block output @@ -259,10 +260,12 @@ class test_repo_test_branch_1234567890: # Update workflow status to completed if not failed if workflow_output["status"] != "failed": workflow_output["status"] = "completed" + else: + raise ApplicationError("Activity error occurred", type="ActivityError", non_retryable=True) return workflow_output except Exception as e: logger.error(f"Workflow failed with error: {e}") workflow_output["status"] = "failed" - raise \ No newline at end of file + raise temporalio.exceptions.ApplicationError("Workflow failed",workflow_output,str(e),type="WorkflowError",non_retryable=True) from e \ No newline at end of file