Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

errors in activity functions does not throw a FunctionFailedException back to the orchestrator function #2990

Open
asanglard-se opened this issue Dec 6, 2024 · 0 comments
Labels
P1 Priority 1

Comments

@asanglard-se
Copy link

asanglard-se commented Dec 6, 2024

Description

With python, errors in activity functions does not throw a FunctionFailedException back to the orchestrator function. It throws a raw/system exception that must be parsed, that is quite complex to analyze...

Expected behavior

Implement what is documented in Azure Durable doc :
https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-error-handling?tabs=python#errors-in-activity-functions

Azure Durable framework should provide a FunctionFailedException that should allow to easly identify the inner exception that was raised by the activity function.

Actual behavior

A raw/system exception is reported. We have to parse with somethings like that get the initial message.

Relevant source code snippets

   # e is the exception
   # the second line contains a json escaped
    escaped_json = e.args[0].split("\n")[1]
    # unescape the json string
    return json.loads(escaped_json)["Message"].split(":", 1)[1].lstrip()

Known workarounds

see snippet above that is actually easy to break if Azure Durable Function change the way that they report the exception

App Details

  • Durable Functions extension version (e.g. v1.8.3): 2.13.5
  • Azure Functions runtime version (1.0 or 2.0): 2.0
  • Programming language used: python 3.11

Screenshots

Inside application insigths, we can see such message:

Exception while executing function: Functions.entity_function_name.....
{"$type":"System.Exception, System.Private.CoreLib","ClassName":"System.Exception","Message":"".....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 Priority 1
Projects
None yet
Development

No branches or pull requests

2 participants