public ExceptionlessModule()
 {
     Get["/"]       = _ => "Hello!";
     Get["/error"]  = _ => { throw new Exception("Unhandled Exception"); };
     Get["/custom"] = _ => {
         ExceptionlessClient.Create(new Exception("Handled Exception")).AddDefaultInformation().AddRequestInfo(Context).Submit();
         return("ok, handled");
     };
 }
예제 #2
0
        public ActionResult Boom25()
        {
            for (int i = 0; i < 25; i++)
            {
                try {
                    throw new ApplicationException("Boom!");
                } catch (Exception ex) {
                    ExceptionlessClient.Create(ex)
                    .SetUserEmail("*****@*****.**")
                    .AddRecentTraceLogEntries()
                    .AddDefaultInformation()
                    .AddRequestInfo()
                    .AddObject(new {
                        Blah = "Hello"
                    }, name: "Hello")
                    .AddTags("SomeTag", "AnotherTag")
                    .MarkAsCritical()
                    .Submit();

                    ex.ToExceptionless().Submit();

                    ex.ToExceptionless()
                    .SetUserEmail("*****@*****.**")
                    .SetUserDescription("Some description.")
                    .SetUserName("someusername")
                    .AddRecentTraceLogEntries()
                    .AddDefaultInformation()
                    .AddRequestInfo()
                    .AddObject(new {
                        Blah = "Hello"
                    }, name: "Hello", excludedPropertyNames: new[] { "Blah" })
                    .AddTags("SomeTag", "AnotherTag")
                    .MarkAsCritical()
                    .Submit();
                }

                Thread.Sleep(1500);
            }

            return(RedirectToAction("Index"));
        }