Source:
<code>public static QuestionCoreProcessor create(final QuestionResponseReadDAO questionResponseReadDAO, final QuestionResponseDAO questionResponseDAO) { <START> final List<Question> allQuestions = questionResponseReadDAO.getAllQuestions(); <END> if (allQuestions.isEmpty()) { try { throw new Exception("getAllQuestions failed: please check postgres"); } catch (Exception e) { e.printStackTrace(); } } final Map<Integer, Question> allQuestionIdMap = new HashMap<>(); final List<Question> onboardingQuestions = Lists.newArrayList(); final List<Question> anomalyQuestions = Lists.newArrayList(); final List<Question> dailyQuestions = Lists.newArrayList(); final List<Question> demoQuestions = Lists.newArrayList(); final List<Question> surveyQuestions = Lists.newArrayList(); for (final Question question : allQuestions) { allQuestionIdMap.put(question.id, question); if (question.category == QuestionCategory.ONBOARDING) { onboardingQuestions.add(question); } if (question.category == QuestionCategory.ANOMALY_LIGHT) { anomalyQuestions.add(question); } if (question.category == QuestionCategory.DAILY) { dailyQuestions.add(question); } if (question.category == QuestionCategory.DEMO) { demoQuestions.add(question); } if (question.category == QuestionCategory.SURVEY) { surveyQuestions.add(question); } } if (dailyQuestions.size() < 2) { try { throw new Exception("less than 2 daily questions avail: please check postgres"); } catch (Exception e) { e.printStackTrace(); } } return new QuestionCoreProcessor(questionResponseReadDAO, questionResponseDAO, allQuestionIdMap, onboardingQuestions, anomalyQuestions, dailyQuestions, demoQuestions, surveyQuestions); }</code><technical_language>this throw exception? If so, in a try/catch</technical_language>

Target:
public static QuestionCoreProcessor create(final QuestionResponseReadDAO questionResponseReadDAO, final QuestionResponseDAO questionResponseDAO) { final List<Question> allQuestions = questionResponseReadDAO.getAllQuestions(); if (allQuestions.isEmpty()) { LOGGER.error("error=no-questions source=postgres"); } final Map<Integer, Question> allQuestionIdMap = new HashMap<>(); final List<Question> onboardingQuestions = Lists.newArrayList(); final List<Question> anomalyQuestions = Lists.newArrayList(); final List<Question> dailyQuestions = Lists.newArrayList(); final List<Question> demoQuestions = Lists.newArrayList(); final List<Question> surveyQuestions = Lists.newArrayList(); for (final Question question : allQuestions) { allQuestionIdMap.put(question.id, question); if (question.category == QuestionCategory.ONBOARDING) { onboardingQuestions.add(question); } if (question.category == QuestionCategory.ANOMALY_LIGHT) { anomalyQuestions.add(question); } if (question.category == QuestionCategory.DAILY) { dailyQuestions.add(question); } if (question.category == QuestionCategory.DEMO) { demoQuestions.add(question); } if (question.category == QuestionCategory.SURVEY) { surveyQuestions.add(question); } } if (dailyQuestions.size() < 2) { LOGGER.error("error=dailyQuestions source=postgres"); } return new QuestionCoreProcessor(questionResponseReadDAO, questionResponseDAO, allQuestionIdMap, onboardingQuestions, anomalyQuestions, dailyQuestions, demoQuestions, surveyQuestions); }