diff --git a/common/lib/capa/capa/capa_problem.py b/common/lib/capa/capa/capa_problem.py index a3354b47c6..bce772e573 100644 --- a/common/lib/capa/capa/capa_problem.py +++ b/common/lib/capa/capa/capa_problem.py @@ -190,7 +190,17 @@ class LoncapaProblem(object): problem_text = problem_text.encode('utf-8') self.tree = etree.XML(problem_text) - self.make_xml_compatible(self.tree) + try: + self.make_xml_compatible(self.tree) + except Exception: + capa_module = self.capa_module + log.exception( + "CAPAProblemError: %s, id:%s, data: %s", + capa_module.display_name, + self.problem_id, + capa_module.data + ) + raise # handle any tags self._process_includes()