Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tippmar-nr committed Dec 18, 2024
1 parent 6baadd4 commit c39c9ed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ private void HandleConnectionException(Exception ex)
// Occurs when the agent is unable to connect to APM. The request failed due to an underlying
// issue such as network connectivity, DNS failure, server certificate validation or timeout.
case HttpRequestException:
// Occurs when HttpClient.SendAsync() times out on .NET 6+
case TaskCanceledException:
#endif
// Occurs when the agent connects to APM but the connection gets aborted by the collector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private DataTransportResponse<T> TrySendDataRequest<T>(string method, params obj
return new DataTransportResponse<T>(DataTransportResponseStatus.Retain);
}
#if !NETFRAMEWORK
catch (Exception ex) when (ex is TaskCanceledException) // This exception is specific to .NET Core
catch (Exception ex) when (ex is TaskCanceledException) // This exception is specific to .NET 6+
{
LogErrorResponse(ex, method, startTime, null);
return new DataTransportResponse<T>(DataTransportResponseStatus.Retain);
Expand Down

0 comments on commit c39c9ed

Please sign in to comment.