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__13 1.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__12 1.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__53 1.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__45 1.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
@tohling @cgillum why not a CallActivityAsync methods without an input parameter. What if we want to call an activity without passing any arguments ?
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 ?