/// <summary>
 /// Gets information about the HTTP request and response when the exception occurred
 /// and populates a <see cref="HttpRequestContext"/> object.
 /// </summary>
 private HttpRequestContext CreateHttpRequestContext(IContextWrapper context)
 {
     return(new HttpRequestContext()
     {
         Method = context?.GetHttpMethod() ?? "",
         Url = context?.GetUri() ?? "",
         UserAgent = context?.GetUserAgent() ?? "",
         ResponseStatusCode = context?.GetStatusCode() ?? 0,
     });
 }
Esempio n. 2
0
 /// <summary>
 /// Gets information about the HTTP request and response when the exception occurred
 /// and populates a <see cref="Struct"/>.
 /// </summary>
 private Struct CreateHttpRequestContext(IContextWrapper context)
 {
     return(new Struct
     {
         Fields =
         {
             { "method",             Value.ForString(context?.GetHttpMethod() ?? "") },
             { "url",                Value.ForString(context?.GetUri() ?? "")        },
             { "userAgent",          Value.ForString(context?.GetUserAgent() ?? "")  },
             { "responseStatusCode", Value.ForNumber(context?.GetStatusCode() ?? 0)  }
         }
     });
 }