Azure-functions-durable-extension: Passing null parameter into Activity causes exception

Created on 19 Jan 2018  路  2Comments  路  Source: Azure/azure-functions-durable-extension

If I add a new Function, choosing the Durable function template, I get an exception if I pass in null for the string.

[FunctionName("Function1")]
public static async Task<List<string>> RunOrchestrator(
    [OrchestrationTrigger] DurableOrchestrationContext context)
{
    var outputs = new List<string>();

    outputs.Add(await context.CallActivityAsync<string>("Function1_Hello", "Tokyo"));
    outputs.Add(await context.CallActivityAsync<string>("Function1_Hello", ""));
    outputs.Add(await context.CallActivityAsync<string>("Function1_Hello", null));  // exception

    return outputs;
}

[FunctionName("Function1_Hello")]
public static string SayHello([ActivityTrigger] string name, TraceWriter log)
{
    log.Info($"Saying hello to {name}.");
    return $"Hello {name}!";
}

DurableTask.Core.Exceptions.TaskFailedException
HResult=0x80131500
Message=Exception while executing function: Function1_Hello
Source=System.Private.CoreLib
StackTrace:
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at DurableTask.Core.TaskOrchestrationContext.<ScheduleTaskInternal>d__14.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
at DurableTask.Core.TaskOrchestrationContext.d__131.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
at DurableTask.Core.TaskOrchestrationContext.d__121.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
at Microsoft.Azure.WebJobs.DurableOrchestrationContext.d__531.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
at Microsoft.Azure.WebJobs.DurableOrchestrationContext.d__451.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
at FunctionApp1.Function1.d__0.MoveNext() in D:\Repos\XXXX\FunctionApp1\Function1.cs:line 21

Most helpful comment

@tohling @cgillum why not a CallActivityAsync methods without an input parameter. What if we want to call an activity without passing any arguments ?

All 2 comments

@tohling @cgillum why not a CallActivityAsync methods without an input parameter. What if we want to call an activity without passing any arguments ?

Was this page helpful?
0 / 5 - 0 ratings