public IHttpActionResult Record(ClientExceptionModel model) { // Create the exception and exception context var exception = new ClientException(model); 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(StatusCode(HttpStatusCode.NoContent)); }
public ClientException(ClientExceptionModel model) : base(model.ToString()) { }