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

HttpRequestMessage caught from the orchestrator does not contain the original exception content #881

Closed
ggirard07 opened this issue Aug 1, 2019 · 2 comments
Labels
bug Needs: Investigation 🔍 A deeper investigation needs to be done by the project maintainers.

Comments

@ggirard07
Copy link

Description

HttpRequestException thrown from an activity does not contain the original exception message when caught in the orchestrator.

I made a sample app to demonstrate the issue: https://github.com/ggirard07/DurableFunctionWithHttpRequestException

Expected behavior

Original message of the exception should be available in the ex.InnerException.Message property.

Actual behavior

Content of the ex.InnerException.Message property is always

Exception of type 'System.Net.Http.HttpRequestException' was thrown.

Relevant source code snippets

[FunctionName("DurableFunction")]
public static async Task<List<string>> RunOrchestrator( [OrchestrationTrigger] DurableOrchestrationContext context ILogger log)
{
    ...
    try
    {
        outputs.Add(await context.CallActivityAsync<string>("DurableFunction_Hello", "London"));
    }
    catch (FunctionFailedException ex)
    {
        //at that point, ex.InnerException.Message is no longer the original content
    }
    ...
}

[FunctionName("DurableFunction_Hello")]
public static string SayHello([ActivityTrigger] string name, ILogger log)
{
    throw new HttpRequestException("This is the message of my original HttpRequestException....");
}

Known workarounds

Provide a description of any known workarounds you used.

App Details

  • Durable Functions extension version (e.g. v1.8.3): v1.8.3
  • Azure Functions runtime version (1.0 or 2.0): v2.0.12555.0
  • Programming language used: C#/dotnet
@ghost ghost added the Needs: Triage 🔍 label Aug 1, 2019
@cgillum cgillum added bug Needs: Investigation 🔍 A deeper investigation needs to be done by the project maintainers. and removed Needs: Triage 🔍 labels Aug 2, 2019
@fabio-muramatsu
Copy link

Hi,
I just hit this issue when testing durable functions. The FunctionFailedException that is caught by the orchestrator has an inner exception of the right type, but as mentioned by @ggirard07, the message and stack trace are not retained. @cgillum Are there any plans to change this behavior to retain the original contents of the exception thrown by the Activity?
The workaround that I'm considering is having the Activities return an object indicating success/failure, along with the exception.
Thank you!

@ConnorMcMahon
Copy link
Contributor

I'm going to track this as a specific sub-case of an issue that would be solved by #314.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Needs: Investigation 🔍 A deeper investigation needs to be done by the project maintainers.
Projects
None yet
Development

No branches or pull requests

4 participants