public void SaveUserData(User user) { var userService = new UserServiceProxy(); var response = userService.SaveUser(user); if (!response.Contains("error", StringComparison.OrdinalIgnoreCase)) { return; } if (response.Contains("database", StringComparison.OrdinalIgnoreCase)) { throw new DatabaseException("Can't save user"); } else { throw new ApplicationException("Fialed to save user, unknown reason"); } }