conflicts = GetConflicts(sbMax4Sale, cStartTime, cEndTime, max4saleViewModel.DailyLimits); if (conflicts > 0) { throw SetConflictsError(conflicts); }where SetConflictsError method is the following:
private HttpResponseException SetConflictsError(int conflicts) { var response = (conflicts == 1) ? Messages.existingConflict : String.Format(Messages.xExistingConflicts, conflicts); return new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError) { Content = new StringContent(response), ReasonPhrase = response }); }Originally that code was embedded into main code (e.g. not a separate method) and the error was correctly returned back to the interface (e.g. instead of return I had throw in the main method). Now instead I see the generic error and not this error. Do you know what should I do to be able to separate this logic as I call it in a few places?