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

Sub-orchestration's FunctionFailedException.InnerException is null #643

Closed
kijujjav opened this issue Mar 12, 2019 · 8 comments
Closed

Sub-orchestration's FunctionFailedException.InnerException is null #643

kijujjav opened this issue Mar 12, 2019 · 8 comments
Labels
fix-ready Indicates that an issue has been fixed and will be available in the next release.
Milestone

Comments

@kijujjav
Copy link

Issue
I am throwing TaskCanceledException() from the action to the orchestrator and expecting FunctionFailedException.InnerException to have the exception, instead it has null.

Expected
FunctionFailedException.InnerException should have TaskCanceledException().

Additional Details

In action
throw new TaskCanceledException();

In Orchestrator
catch (Exception ex)
{

            if (ex.InnerException is TaskCanceledException)
            {
                log.LogError(ex.Message);
            }
         }

InnerExceprionNull

@cgillum
Copy link
Collaborator

cgillum commented Mar 13, 2019

Do you get the same behavior with any other exception type? I wonder if TaskCanceledException is being inadvertently handled somewhere in the runtime.

@kijujjav
Copy link
Author

InnerException is null no matter what type of exception I throw.

@cgillum
Copy link
Collaborator

cgillum commented Mar 14, 2019

I'm not able to reproduce this behavior:
image

Can you share more details about your app? For example, the version of the Functions runtime (1.0 or 2.0) and the version of the nuget packages you are using?

@kijujjav
Copy link
Author

We are calling context.CallSubOrchestratorAsync and the exception is thrown in the sub-orchestration, does the behavior differ for activity and sub-orchestration?

@kijujjav
Copy link
Author

We are using Functions 2.0 and azure-functions-durable-extension 1.7.1

@cgillum cgillum changed the title FunctionFailedException.InnerException is null Sub-orchestration's FunctionFailedException.InnerException is null Mar 15, 2019
@cgillum cgillum added the Needs: Investigation 🔍 A deeper investigation needs to be done by the project maintainers. label Mar 15, 2019
@cgillum cgillum added this to the Triage milestone Mar 15, 2019
@cgillum
Copy link
Collaborator

cgillum commented Mar 15, 2019

I created the following test case orchestrator function to see whether this is reproduceable in the latest code:

public static async Task SubOrchestrationThrow([OrchestrationTrigger] DurableOrchestrationContext ctx)
{
    string message = ctx.GetInput<string>();

    try
    {
        await ctx.CallSubOrchestratorAsync(nameof(TestOrchestrations.ThrowOrchestrator), message);
    }
    catch (FunctionFailedException e)
    {
        if (e.InnerException == null ||
            e.GetBaseException().GetType() != typeof(InvalidOperationException) ||
            !e.InnerException.Message.Contains(message))
        {
            throw new Exception("InnerException was not the expected value.");
        }

        // rethrow the original exception
        throw;
    }
}

The code worked as expected and the inner-exception was not null. I think for now we can assume that if there was an issue in v1.7.1 that it is fixed in v1.8.0.

@cgillum cgillum added fix-ready Indicates that an issue has been fixed and will be available in the next release. and removed Needs: Investigation 🔍 A deeper investigation needs to be done by the project maintainers. labels Mar 15, 2019
@cgillum cgillum modified the milestones: Triage, v1.8 Release Mar 15, 2019
@cgillum
Copy link
Collaborator

cgillum commented Mar 16, 2019

Resolved with v1.8.0 release.

@cgillum cgillum closed this as completed Mar 16, 2019
@kijujjav
Copy link
Author

Thanks Chris, I don't see the bug in 1.8 version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix-ready Indicates that an issue has been fixed and will be available in the next release.
Projects
None yet
Development

No branches or pull requests

2 participants