Source:
<code>public ActionForward enrolInDegreeModules(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws FenixServiceException { final BolonhaStudentEnrollmentBean bolonhaStudentEnrollmentBean = getBolonhaStudentEnrollmentBeanFromViewState(); try { final RuleResult ruleResults = EnrolBolonhaStudent.run(bolonhaStudentEnrollmentBean.getStudentCurricularPlan(), bolonhaStudentEnrollmentBean.getExecutionPeriod(), bolonhaStudentEnrollmentBean.getDegreeModulesToEvaluate(), bolonhaStudentEnrollmentBean.getCurriculumModulesToRemove(), bolonhaStudentEnrollmentBean.getCurricularRuleLevel()); if (!bolonhaStudentEnrollmentBean.getDegreeModulesToEvaluate().isEmpty() || !bolonhaStudentEnrollmentBean.getCurriculumModulesToRemove().isEmpty()) { addActionMessage("success", request, "label.save.success"); } if (ruleResults.isWarning()) { addRuleResultMessagesToActionMessages("warning", request, ruleResults); } enroledWithSuccess(request, bolonhaStudentEnrollmentBean); } catch (EnrollmentDomainException ex) { addRuleResultMessagesToActionMessages("error", request, ex.getFalseResult()); return prepareShowDegreeModulesToEnrol(mapping, form, request, response, bolonhaStudentEnrollmentBean); } catch (DomainException ex) { addActionMessage("error", request, ex.getKey(), ex.getArgs()); return prepareShowDegreeModulesToEnrol(mapping, form, request, response, bolonhaStudentEnrollmentBean); <START> } catch (org.fenixedu.bennu.core.domain.exceptions.DomainException de) { <END> addActionMessage("error", request, de.getLocalizedMessage(), false); return prepareShowDegreeModulesToEnrol(mapping, form, request, response, bolonhaStudentEnrollmentBean); } RenderUtils.invalidateViewState(); return prepareShowDegreeModulesToEnrol(mapping, form, request, response, bolonhaStudentEnrollmentBean.getStudentCurricularPlan(), bolonhaStudentEnrollmentBean.getExecutionPeriod()); }</code><technical_language>other place in this class a DomainException is replaced this type</technical_language>

Target:
public ActionForward enrolInDegreeModules(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws FenixServiceException { final BolonhaStudentEnrollmentBean bolonhaStudentEnrollmentBean = getBolonhaStudentEnrollmentBeanFromViewState(); try { final RuleResult ruleResults = EnrolBolonhaStudent.run(bolonhaStudentEnrollmentBean.getStudentCurricularPlan(), bolonhaStudentEnrollmentBean.getExecutionPeriod(), bolonhaStudentEnrollmentBean.getDegreeModulesToEvaluate(), bolonhaStudentEnrollmentBean.getCurriculumModulesToRemove(), bolonhaStudentEnrollmentBean.getCurricularRuleLevel()); if (!bolonhaStudentEnrollmentBean.getDegreeModulesToEvaluate().isEmpty() || !bolonhaStudentEnrollmentBean.getCurriculumModulesToRemove().isEmpty()) { addActionMessage("success", request, "label.save.success"); } if (ruleResults.isWarning()) { addRuleResultMessagesToActionMessages("warning", request, ruleResults); } enroledWithSuccess(request, bolonhaStudentEnrollmentBean); } catch (EnrollmentDomainException ex) { addRuleResultMessagesToActionMessages("error", request, ex.getFalseResult()); return prepareShowDegreeModulesToEnrol(mapping, form, request, response, bolonhaStudentEnrollmentBean); } catch (DomainException de) { addActionMessage("error", request, de.getLocalizedMessage(), false); return prepareShowDegreeModulesToEnrol(mapping, form, request, response, bolonhaStudentEnrollmentBean); } RenderUtils.invalidateViewState(); StudentCurricularPlan scp = getActiveRegistration(bolonhaStudentEnrollmentBean.getStudentCurricularPlan()); return prepareShowDegreeModulesToEnrol(mapping, form, request, response, scp, bolonhaStudentEnrollmentBean.getExecutionPeriod()); }