Skip to content

DTS - Failed activities return a broken error message #562

Description

@andystaples

🐛 Describe the bug
In AzureStorage or MSSQL, if an activity function fails, the orchestrator gets back an exception with relevant information about how the activity failed.
In DTS, you get back None

🤔 Expected behavior
When an activity function fails, the yield statement from the orchestrator should throw an exception with relevant information about how the activity failed, including the message from the exception thrown by the activity.

Steps to reproduce
Orchestrator and activity:

@bp.orchestration_trigger(context_name="context", orchestration="CatchActivityException")
def catch_activity_exception(context: df.DurableOrchestrationContext):
    try:
        yield context.call_activity('raise_exception', context.instance_id)
    except Exception as e:
        logging.error(f"Caught exception: {e}")
        return f"Caught exception: {e}"


@bp.activity_trigger(input_name="instance")
def raise_exception(instance: str) -> str:
    global attempt_count
    if instance not in attempt_count:
        attempt_count[instance] = 1
        raise InvalidOperationException(f"This activity failed")
    return "This activity succeeded"

The return value for Azure Storage/MSSQL:

Caught exception: Activity function 'raise_exception' failed: 

The return value for DTS:

Caught exception: None \n None

If deployed to Azure
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Priority 2bugSomething isn't workingfixed-in-v2Fixed in azure-functions-durable 2.x

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions