Esempio n. 1
0
 public static ErrorModel Create(Error error, string logId)
 {
     return(new ErrorModel
     {
         Guid = Guid.NewGuid().ToString(),
         Detail = error.Detail,
         LogId = logId,
         Host = Host(error.ServerVariables),
         Type = error.Type,
         Source = error.Source,
         Message = error.Message,
         User = error.User,
         Time = error.Time,
         StatusCode = error.StatusCode,
         ServerVariables = MonitorrHelpers.ToDictionary(error.ServerVariables),
         QueryString = MonitorrHelpers.ToDictionary(error.QueryString),
         Form = MonitorrHelpers.ToDictionary(error.Form),
         Cookies = MonitorrHelpers.ToDictionary(error.Cookies),
         Browser = Browser(error.ServerVariables),
         Severity = GetSeverity(error.StatusCode),
         Url = Url(error.ServerVariables),
         IsCustom = false,
         Method = Method(error.ServerVariables)
     });
 }
Esempio n. 2
0
        private static Dictionary <string, string> Form(HttpContext context)
        {
            try
            {
                return(MonitorrHelpers.ToDictionary(context.Request?.Form));
            }
            catch (InvalidOperationException)
            {
            }

            return(null);
        }
Esempio n. 3
0
 private static Dictionary <string, string> Cookies(HttpContext context)
 {
     return(MonitorrHelpers.ToDictionary(context.Request?.Cookies));
 }
Esempio n. 4
0
 private static Dictionary <string, string> ServerVariables(HttpContext context)
 {
     return(MonitorrHelpers.ToDictionary(context.Request?.Headers));
 }
Esempio n. 5
0
 private static Dictionary <string, string> QueryString(HttpContext context)
 {
     return(MonitorrHelpers.ToDictionary(context.Request?.QueryString));
 }