java/code/src/com/redhat/rhn/frontend/action/tasko/ScheduleDetailAction.java | 13
+++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
New commits:
commit 74c41853fae70b9e3f81c1cd6a5b3bd6a5e8a177
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Thu May 19 18:28:03 2011 +0200
659138 - fix Custom Quartz format error handling
fixing issues, when Custome Quartz format is submitted empty or in wrong format
diff --git a/java/code/src/com/redhat/rhn/frontend/action/tasko/ScheduleDetailAction.java
b/java/code/src/com/redhat/rhn/frontend/action/tasko/ScheduleDetailAction.java
index 436e2b4..db7c810 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/tasko/ScheduleDetailAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/tasko/ScheduleDetailAction.java
@@ -21,6 +21,7 @@ import com.redhat.rhn.frontend.struts.RhnAction;
import com.redhat.rhn.taskomatic.TaskomaticApi;
import com.redhat.rhn.taskomatic.TaskomaticApiException;
+import org.apache.commons.lang.StringUtils;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
@@ -87,7 +88,7 @@ public class ScheduleDetailAction extends RhnAction {
RecurringEventPicker picker = RecurringEventPicker.prepopulatePicker(
request, "date", null);
- if (picker.isDisabled()) {
+ if (picker.isDisabled() || StringUtils.isEmpty(picker.getCronEntry())) {
if (scheduleId == null) {
prepDropdowns(ctx);
createErrorMessage(request, "message.scheduledisabled", null);
@@ -122,8 +123,14 @@ public class ScheduleDetailAction extends RhnAction {
mapping.findForward("success"), params);
}
catch (TaskomaticApiException e) {
- createErrorMessage(request,
- "repos.jsp.message.taskomaticdown", null);
+ if (e.getMessage().contains("InvalidParamException")) {
+ createErrorMessage(request,
+ "repos.jsp.message.invalidcron",
picker.getCronEntry());
+ }
+ else {
+ createErrorMessage(request,
+ "repos.jsp.message.taskomaticdown", null);
+ }
return getStrutsDelegate().forwardParams(
mapping.findForward("default"), params);
}