Skip to content

Commit

Permalink
Merge pull request #151 from amosproj/dev-#107
Browse files Browse the repository at this point in the history
Implementation of Dev #107
  • Loading branch information
Waldleufer authored Jul 7, 2021
2 parents f300511 + 54c779f commit ffa3d08
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
if (request.RequestUri.ToString().Contains("api/calculation"))
{
var requestResponse = await base.SendAsync(request, cancellationToken);
if (!requestResponse.IsSuccessStatusCode)
{
return requestResponse;
}
var contentString = await requestResponse.Content.ReadAsStringAsync();
//Retrieve the CalculationId from the post request
var responseContent = JObject.Parse(contentString);
Expand All @@ -43,7 +47,10 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
while (true)
{
calculationStateResponse = await base.SendAsync(calculationStateRequest, cancellationToken);

if (!calculationStateResponse.IsSuccessStatusCode)
{
return calculationStateResponse;
}
var calculationResponseContent = JObject.Parse(await calculationStateResponse.Content.ReadAsStringAsync());
var calculationResultStatus = calculationResponseContent["Result"].ToString();

Expand Down

0 comments on commit ffa3d08

Please sign in to comment.