Commit 3355f804 by Calen Pennington

Add logging of filename when module file parsing fails

parent e172be3a
......@@ -3,6 +3,10 @@ This config file runs the simplest dev environment"""
from .common import *
import logging
import sys
logging.basicConfig(stream=sys.stdout, )
DEBUG = True
TEMPLATE_DEBUG = DEBUG
......
......@@ -2,7 +2,9 @@ from collections import MutableMapping
from xmodule.x_module import XModuleDescriptor
from lxml import etree
import copy
import logging
log = logging.getLogger(__name__)
class LazyLoadingDict(MutableMapping):
"""
......@@ -124,7 +126,11 @@ class XmlDescriptor(XModuleDescriptor):
else:
filepath = cls._format_filepath(xml_object.tag, filename)
with system.resources_fs.open(filepath) as file:
definition_xml = etree.parse(file).getroot()
try:
definition_xml = etree.parse(file).getroot()
except:
log.exception("Failed to parse xml in file %s" % filepath)
raise
cls.clean_metadata_from_xml(definition_xml)
return cls.definition_from_xml(definition_xml, system)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment