in sdk/src/Handlers/System.Net/HttpWebRequestTracingExtension.cs [42:73]
public static WebResponse GetResponseTraced(this WebRequest request, bool sanitizeHttpRequestTracing = false)
{
RequestUtil.ProcessRequest(request, sanitizeHttpRequestTracing);
try
{
var response = (HttpWebResponse)request.GetResponse();
RequestUtil.ProcessResponse(response);
return response;
}
catch (Exception e)
{
AWSXRayRecorder.Instance.AddException(e);
if (e is WebException webException)
{
var exceptionResponse = (HttpWebResponse)webException.Response;
if (exceptionResponse != null)
{
RequestUtil.ProcessResponse(exceptionResponse);
}
}
throw;
}
finally
{
AWSXRayRecorder.Instance.EndSubsegment();
}
}