public HttpResponseException LogException(Exception ex) { string errorMessage = LoggerHelper.GetExceptionDetails(ex); _logger.LogError(LoggingEvents.SERVICE_ERROR, ex, errorMessage); HttpResponseMessage message = new HttpResponseMessage(); message.Content = new StringContent(errorMessage); message.StatusCode = System.Net.HttpStatusCode.ExpectationFailed; throw new HttpResponseException(message); }