public HttpServiceError(ServiceException exception, bool includeErrorDetail = false) { if (exception == null) { throw new ArgumentNullException("exception"); } _includeErrorDetail = includeErrorDetail; _httpError = Populate((dynamic) exception, out _statusCode); }
private HttpError Populate(ServiceException exception, out HttpStatusCode statusCode) { var httpError = new HttpError(exception, _includeErrorDetail) { {"ErrorType", "service"} }; httpError.Message = exception.Message; statusCode = HttpStatusCode.InternalServerError; return httpError; }
private void OnException(ServiceException exception) { if (exception.TransactionRollback) { _transaction.Rollback(); } else { _transaction.Commit(); } }