public IHttpActionResult Record(AngularExceptionModel model)
        {
            // Create the exception and exception context
            var exception = new AngularException(model.ToString());
            var catchBlock = new ExceptionContextCatchBlock("catchBlock", true, false);
            var context = new ExceptionContext(exception, catchBlock, Request);
            var loggerContext = new ExceptionLoggerContext(context);

            // Call elmah & log the exception
            var logger = new ExceptionHandling.ElmahExceptionLogger();
            logger.Log(loggerContext);

            // Return
            return Ok();
        }
示例#2
0
        public IHttpActionResult Record(AngularExceptionModel model)
        {
            // Create the exception and exception context
            var exception     = new AngularException(model.ToString());
            var catchBlock    = new ExceptionContextCatchBlock("catchBlock", true, false);
            var context       = new ExceptionContext(exception, catchBlock, Request);
            var loggerContext = new ExceptionLoggerContext(context);

            // Call elmah & log the exception
            var logger = new ExceptionHandling.ElmahExceptionLogger();

            logger.Log(loggerContext);

            // Return
            return(Ok());
        }