Skip to content

Commit

Permalink
retry result can be null so handle it better (#142)
Browse files Browse the repository at this point in the history
Co-authored-by: Alan Rynne <[email protected]>
  • Loading branch information
adamhathcock and AlanRynne authored Oct 17, 2024
1 parent 8f8be74 commit 3c783b3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Speckle.Sdk/Helpers/SpeckleHttpClientHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,16 @@ CancellationToken cancellationToken
.ConfigureAwait(false);
context.TryGetValue("retryCount", out var retryCount);
activity?.SetTag("retryCount", retryCount);
activity?.SetStatus(
policyResult.Result.IsSuccessStatusCode ? SdkActivityStatusCode.Ok : SdkActivityStatusCode.Error
);
if (policyResult.FinalException != null)
{
activity?.RecordException(policyResult.FinalException);
activity?.SetStatus(SdkActivityStatusCode.Error);
}
else
{
activity?.SetStatus(
policyResult.Result.IsSuccessStatusCode ? SdkActivityStatusCode.Ok : SdkActivityStatusCode.Error
);
}

if (policyResult.Outcome == OutcomeType.Successful)
Expand Down

0 comments on commit 3c783b3

Please sign in to comment.