Skip to content

Commit

Permalink
SAK-29521 Added some try catch guards to CMS calls
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholaswilson100 authored and adrianfish committed Jun 15, 2015
1 parent 8532939 commit 7237076
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions roster2/src/java/org/sakaiproject/roster/impl/SakaiProxyImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import org.sakaiproject.coursemanagement.api.Enrollment;
import org.sakaiproject.coursemanagement.api.EnrollmentSet;
import org.sakaiproject.coursemanagement.api.Section;
import org.sakaiproject.coursemanagement.api.exception.IdNotFoundException;
import org.sakaiproject.exception.IdUnusedException;
import org.sakaiproject.memory.api.Cache;
import org.sakaiproject.memory.api.MemoryService;
Expand Down Expand Up @@ -774,7 +775,14 @@ private Map<String, List<RosterMember>> getAndCacheSortedEnrollmentSet(Site site
if (log.isDebugEnabled()) {
log.debug("Cache miss on '" + enrollmentSetId + "'");
}
EnrollmentSet enrollmentSet = courseManagementService.getEnrollmentSet(enrollmentSetId);

EnrollmentSet enrollmentSet = null;
try {
enrollmentSet = courseManagementService.getEnrollmentSet(enrollmentSetId);
} catch (IdNotFoundException idNotFoundException){
// This is okay, let this go, as we're not expecting
// the site necessarily to be part of coursemanagement.
}

if (null == enrollmentSet) {
return null;
Expand Down Expand Up @@ -972,7 +980,14 @@ private List<RosterEnrollment> getEnrollmentSets(String siteId,

for (String sectionId : sectionIds) {

Section section = courseManagementService.getSection(sectionId);
Section section = null;
try {
section = courseManagementService.getSection(sectionId);
} catch (IdNotFoundException idNotFoundException){
// This is okay, let this go, as we're not expecting
// groups necessarily to be part of coursemanagement.
}

if (null == section) {
continue;
}
Expand Down

0 comments on commit 7237076

Please sign in to comment.