Skip to content

Commit 0db6f62

Browse files
jesusmmpMiguel Pellicer
authored and
Miguel Pellicer
committed
SA-47689 Direct request failure: IllegalArgumentException:Invalid event id (:ID:), the id must be a number -- signupEvent
1 parent 6a83794 commit 0db6f62

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

signup/tool/src/java/org/sakaiproject/signup/tool/entityproviders/SignupEventEntityProvider.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
import java.util.List;
3838
import java.util.Map;
3939

40+
import javax.servlet.http.HttpServletResponse;
41+
4042
import org.sakaiproject.entitybroker.EntityReference;
4143
import org.sakaiproject.entitybroker.entityprovider.CoreEntityProvider;
4244
import org.sakaiproject.entitybroker.entityprovider.capabilities.CollectionResolvable;
@@ -48,6 +50,7 @@
4850
import org.sakaiproject.entitybroker.entityprovider.extension.TemplateMap;
4951
import org.sakaiproject.entitybroker.entityprovider.search.Restriction;
5052
import org.sakaiproject.entitybroker.entityprovider.search.Search;
53+
import org.sakaiproject.entitybroker.exception.EntityException;
5154
import org.sakaiproject.entitybroker.util.AbstractEntityProvider;
5255
import org.sakaiproject.signup.logic.SakaiFacade;
5356
import org.sakaiproject.signup.logic.SignupMeetingService;
@@ -95,7 +98,7 @@ public boolean entityExists(String id) {
9598
try {
9699
eventId = new Long(id);
97100
} catch (NumberFormatException e) {
98-
throw new IllegalArgumentException("Invalid event id (" + id + "), the id must be a number");
101+
throw new EntityException("Invalid identifier provided for signupEvent", "", HttpServletResponse.SC_NOT_ACCEPTABLE);
99102
}
100103
return getSignupMeetingService().isEventExisted(eventId);
101104
}
@@ -109,7 +112,7 @@ private SignupEvent getEventById(String id, boolean mustAccessDB) {
109112
try {
110113
eventId = new Long(id);
111114
} catch (NumberFormatException e) {
112-
throw new IllegalArgumentException("Invalid event id (" + id + "), the id must be a number");
115+
throw new EntityException("Invalid identifier provided for signupEvent", "", HttpServletResponse.SC_NOT_ACCEPTABLE);
113116
}
114117

115118
String siteId = developerHelperService.getCurrentLocationId();

0 commit comments

Comments
 (0)