private HttpResponseMessage InternalCreateHttpResponseMessage(SparkException exception, HttpRequestMessage request) { if (exception == null) { return(null); } OperationOutcome outcome = exception.Outcome ?? new OperationOutcome(); outcome.AddAllInnerErrors(exception); return(request.CreateResponse(exception.StatusCode, outcome));; }