[TNL-8235] - Fix breaking code by updating the exception when load_file fails. (#27368)
Co-authored-by: SaadYousaf <saadyousaf@A006-00314.local>
This commit is contained in:
@@ -5,9 +5,7 @@ import copy
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
|
||||
import six
|
||||
from lxml import etree
|
||||
from lxml.etree import Element, ElementTree, XMLParser
|
||||
from xblock.core import XML_NAMESPACES
|
||||
@@ -213,9 +211,7 @@ class XmlParserMixin:
|
||||
return cls.file_to_xml(xml_file)
|
||||
except Exception as err: # lint-amnesty, pylint: disable=broad-except
|
||||
# Add info about where we are, but keep the traceback
|
||||
msg = 'Unable to load file contents at path {} for item {}: {} '.format(
|
||||
filepath, def_id, err)
|
||||
six.reraise(Exception, msg, sys.exc_info()[2])
|
||||
raise Exception(f'Unable to load file contents at path {filepath} for item {def_id}: {err}') from err
|
||||
|
||||
@classmethod
|
||||
def load_definition(cls, xml_object, system, def_id, id_generator):
|
||||
|
||||
Reference in New Issue
Block a user