Esempio n. 1
0
        protected virtual IEnumerable<AirbrakeVar> BrowserData(IExceptionInformation exInfo,
            IEnvironmentInformation envInfo)
        {
            if (HttpRequest.Browser == null)
                return Enumerable.Empty<AirbrakeVar>();

            return new[]
            {
                new AirbrakeVar("Browser.Browser", HttpRequest.Browser.Browser),
                new AirbrakeVar("Browser.ClrVersion", HttpRequest.Browser.ClrVersion),
                new AirbrakeVar("Browser.Cookies", HttpRequest.Browser.Cookies),
                new AirbrakeVar("Browser.Crawler", HttpRequest.Browser.Crawler),
                new AirbrakeVar("Browser.EcmaScriptVersion", HttpRequest.Browser.EcmaScriptVersion),
                new AirbrakeVar("Browser.JavaApplets", HttpRequest.Browser.JavaApplets),
                new AirbrakeVar("Browser.MajorVersion", HttpRequest.Browser.MajorVersion),
                new AirbrakeVar("Browser.MinorVersion", HttpRequest.Browser.MinorVersion),
                new AirbrakeVar("Browser.Platform", HttpRequest.Browser.Platform),
                new AirbrakeVar("Browser.W3CDomVersion", HttpRequest.Browser.W3CDomVersion)
            };
        }
Esempio n. 2
0
 protected virtual string Url(IExceptionInformation exInfo, IEnvironmentInformation envInfo)
 {
     return exInfo.CatchingFile;
 }
Esempio n. 3
0
 protected virtual IEnumerable<AirbrakeVar> Session(IExceptionInformation exInfo, IEnvironmentInformation envInfo)
 {
     return Enumerable.Empty<AirbrakeVar>();
 }
Esempio n. 4
0
 protected virtual AirbrakeRequest Request(IExceptionInformation exInfo, IEnvironmentInformation envInfo)
 {
     return new AirbrakeRequest(envInfo.Uri, exInfo.CatchingFile, exInfo.CatchingMethod.Name)
     {
         Url = Url(exInfo, envInfo),
         CgiData = CgiData(exInfo, envInfo).ToArray(),
         Params = Params(exInfo, envInfo).ToArray(),
         Session = Session(exInfo, envInfo).ToArray()
     };
 }
Esempio n. 5
0
        /// <summary>
        /// Creates a <see cref="AirbrakeError"/> from the the specified exception.
        /// </summary>
        /// <param name="exInfo"></param>
        /// <param name="envInfo"></param>
        /// <returns>
        /// A <see cref="AirbrakeError"/>, created from the the specified exception.
        /// </returns>
        protected AirbrakeError Error(IExceptionInformation exInfo, IEnvironmentInformation envInfo)
        {
            var error = Activator.CreateInstance<AirbrakeError>();

            error.CatchingMethod = exInfo.CatchingMethod;
            error.Class = exInfo.ExceptionClass.FullName;
            error.Message = exInfo.Message;
            error.Backtrace = exInfo.TraceLines.ToArray();

            return error;
        }
Esempio n. 6
0
 protected override IEnumerable<AirbrakeVar> CgiData(IExceptionInformation exInfo,
     IEnvironmentInformation envInfo)
 {
     return EnvironmentData(exInfo, envInfo).
         Concat(HeadersData(exInfo, envInfo)).
         Concat(CookiesData(exInfo, envInfo)).
         Concat(BrowserData(exInfo, envInfo));
 }
Esempio n. 7
0
 protected override string Url(IExceptionInformation exInfo, IEnvironmentInformation envInfo)
 {
     return HttpRequest.Url.ToString();
 }
Esempio n. 8
0
 protected override IEnumerable<AirbrakeVar> Session(IExceptionInformation exInfo,
     IEnvironmentInformation envInfo)
 {
     return BuildVars(HttpContext.Session);
 }
Esempio n. 9
0
 protected override IEnumerable<AirbrakeVar> Params(IExceptionInformation exInfo, IEnvironmentInformation envInfo)
 {
     return BuildVars(HttpRequest.Params);
 }
Esempio n. 10
0
 protected virtual IEnumerable<AirbrakeVar> HeadersData(IExceptionInformation exInfo,
     IEnvironmentInformation envInfo)
 {
     return BuildVars(HttpRequest.Headers);
 }
Esempio n. 11
0
 protected virtual IEnumerable<AirbrakeVar> EnvironmentData(IExceptionInformation exInfo,
     IEnvironmentInformation envInfo)
 {
     return new[]
     {
         new AirbrakeVar("Environment.MachineName", Environment.MachineName),
         new AirbrakeVar("Environment.OSversion", Environment.OSVersion),
         new AirbrakeVar("Environment.Version", Environment.Version)
     };
 }