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) }); }
private static Dictionary <string, string> Form(HttpContext context) { try { return(MonitorrHelpers.ToDictionary(context.Request?.Form)); } catch (InvalidOperationException) { } return(null); }
private static Dictionary <string, string> Cookies(HttpContext context) { return(MonitorrHelpers.ToDictionary(context.Request?.Cookies)); }
private static Dictionary <string, string> ServerVariables(HttpContext context) { return(MonitorrHelpers.ToDictionary(context.Request?.Headers)); }
private static Dictionary <string, string> QueryString(HttpContext context) { return(MonitorrHelpers.ToDictionary(context.Request?.QueryString)); }