diff --git a/common/lib/xmodule/xmodule/course_module.py b/common/lib/xmodule/xmodule/course_module.py index 8056b7f7eb..8bdd5509b9 100644 --- a/common/lib/xmodule/xmodule/course_module.py +++ b/common/lib/xmodule/xmodule/course_module.py @@ -1,8 +1,12 @@ +import logging from path import path from xmodule.modulestore import Location from xmodule.seq_module import SequenceDescriptor, SequenceModule from fs.errors import ResourceNotFoundError +log = logging.getLogger(__name__) + + class CourseDescriptor(SequenceDescriptor): module_class = SequenceModule @@ -53,6 +57,7 @@ class CourseDescriptor(SequenceDescriptor): with self.system.resources_fs.open(path("about") / section_key + ".html") as htmlFile: return htmlFile.read() except ResourceNotFoundError: + log.exception("Missing about section {key} in course {url}".format(key=section_key, url=self.location.url())) return "! About section missing !" elif section_key == "title": return self.metadata.get('display_name', self.name) @@ -81,6 +86,7 @@ class CourseDescriptor(SequenceDescriptor): with self.system.resources_fs.open(path("info") / section_key + ".html") as htmlFile: return htmlFile.read() except ResourceNotFoundError: + log.exception("Missing info section {key} in course {url}".format(key=section_key, url=self.location.url())) return "! About section missing !" raise KeyError("Invalid about key " + str(section_key))