Fix SendHttpRequestActivity response handling logic
This fixes a bug where the "unmatched status code" activity would be scheduled even if the returned status code was defined as an expected outcome.
This commit is contained in:
parent
68a20de07f
commit
9416461f78
|
|
@ -40,8 +40,14 @@ public class SendHttpRequest : SendHttpRequestBase
|
|||
var expectedStatusCodes = ExpectedStatusCodes;
|
||||
var statusCode = (int)response.StatusCode;
|
||||
var matchingCase = expectedStatusCodes.FirstOrDefault(x => x.StatusCode == statusCode);
|
||||
var activity = matchingCase?.Activity ?? UnmatchedStatusCode;
|
||||
var activity = matchingCase != null ? matchingCase.Activity : UnmatchedStatusCode;
|
||||
|
||||
if(activity == null)
|
||||
{
|
||||
await context.CompleteActivityAsync();
|
||||
return;
|
||||
}
|
||||
|
||||
await context.ScheduleActivityAsync(activity, OnChildActivityCompletedAsync);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue