handle another error caused by invalid LMS Setup access

This commit is contained in:
anhefti 2020-12-17 19:34:48 +01:00
parent 7ad3dc77b5
commit 69f8d6cd4a

View file

@ -157,6 +157,7 @@ public class LmsAPIServiceImpl implements LmsAPIService {
// case 1. if lmsSetupId is available only get quizzes from specified LmsSetup
final Long lmsSetupId = filterMap.getLmsSetupId();
if (lmsSetupId != null) {
try {
final Long institutionId = filterMap.getInstitutionId();
final LmsAPITemplate template = getLmsAPITemplate(lmsSetupId)
@ -168,6 +169,10 @@ public class LmsAPIServiceImpl implements LmsAPIService {
return template
.getQuizzes(filterMap)
.getOrThrow();
} catch (final Exception e) {
log.error("Failed to get quizzes from LMS Setup: {}", lmsSetupId, e);
return Collections.emptyList();
}
}
// case 2. get quizzes from all LmsSetups of specified institution