fixed error for getting exams on invalid LMS Setup

This commit is contained in:
anhefti 2020-12-17 19:25:39 +01:00
parent 9941d57d44
commit 7ad3dc77b5

View file

@ -756,9 +756,15 @@ public class ExamDAOImpl implements ExamDAO {
return lmsSetupToRecordMapping
.entrySet()
.stream()
.flatMap(entry -> toDomainModel(entry.getKey(), entry.getValue(), cached)
.getOrThrow()
.stream())
.flatMap(entry -> toDomainModel(
entry.getKey(),
entry.getValue(),
cached)
.onError(error -> log.error(
"Failed to get quizzes form LMS Setup: {}",
entry.getKey(), error))
.getOr(Collections.emptyList())
.stream())
.collect(Collectors.toList());
});
}