Skip to content
Snippets Groups Projects
Commit f9f9f06f authored by srosse's avatar srosse
Browse files

OO-475: make the 8.2 upgrader more robust and the read method of the course too

parent ba632cb5
No related branches found
No related tags found
No related merge requests found
......@@ -425,8 +425,13 @@ public class PersistingCourseImpl implements ICourse, OLATResourceable, Serializ
if (vfsItem == null || !(vfsItem instanceof VFSLeaf)) {
throw new CorruptedCourseException("Cannot resolve file: " + fileName + " course=" + toString());
}
XStream xstream = CourseXStreamAliases.getReadCourseXStream();
return XStreamHelper.readObject(xstream, ((VFSLeaf)vfsItem).getInputStream());
try {
XStream xstream = CourseXStreamAliases.getReadCourseXStream();
return XStreamHelper.readObject(xstream, ((VFSLeaf)vfsItem).getInputStream());
} catch (Exception e) {
log.error("Cannot read course tree file: " + fileName);
throw new CorruptedCourseException("Cannot resolve file: " + fileName + " course=" + toString(), e);
}
}
/**
......
......@@ -176,6 +176,8 @@ public class OLATUpgrade_8_2_0 extends OLATUpgrade {
course.postImport(envMapper);
} catch (CorruptedCourseException e) {
log.error("Course seems corrupt: " + entry.getOlatResource().getResourceableId());
} catch (Exception e) {
log.error("Course seems highly corrupt: " + entry.getOlatResource().getResourceableId());
}
}
dbInstance.intermediateCommit();
......@@ -183,7 +185,7 @@ public class OLATUpgrade_8_2_0 extends OLATUpgrade {
log.audit("Processed repository entries: " + entries.size());
} while(entries.size() == REPO_ENTRIES_BATCH_SIZE);
uhd.setBooleanDataValue(TASK_CONDITIONS, false);
uhd.setBooleanDataValue(TASK_CONDITIONS, true);
upgradeManager.setUpgradesHistory(uhd, VERSION);
}
return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment