use of io.imunity.furms.api.validation.exceptions.AlarmAlreadyExceedThresholdException in project furms by unity-idm.
the class AlarmFormView method saveAlarm.
private void saveAlarm() {
AlarmFormModel alarmFormModel = binder.getBean();
AlarmWithUserEmails alarm = AlarmFormModelMapper.map(projectId, alarmFormModel);
try {
if (alarmFormModel.id == null)
alarmService.create(alarm);
else
alarmService.update(alarm);
UI.getCurrent().navigate(AlarmsView.class);
} catch (DuplicatedNameValidationError e) {
showErrorNotification(getTranslation("name.duplicated.error.message"));
} catch (EmailNotPresentException e) {
showErrorNotification(getTranslation("alarm.wrong.user", e.email));
} catch (AlarmAlreadyExceedThresholdException e) {
showErrorNotification(getTranslation("alarm.wrong.threshold"));
} catch (FiredAlarmThresholdReduceException e) {
showErrorNotification(getTranslation("fired.alarm.wrong.threshold"));
} catch (Exception e) {
showErrorNotification(getTranslation("base.error.message"));
throw e;
}
}
Aggregations