Commit 822eaa20 by Calen Pennington

Make ErrorDescriptor more resistent to errors

parent d919d2ae
......@@ -108,7 +108,7 @@ class ErrorDescriptor(ErrorFields, XModuleDescriptor):
cls,
# The error module doesn't use scoped data, and thus doesn't need
# real scope keys
ScopeIds('error', None, location, location),
ScopeIds(None, 'error', location, location),
field_data,
)
......@@ -120,9 +120,14 @@ class ErrorDescriptor(ErrorFields, XModuleDescriptor):
@classmethod
def from_json(cls, json_data, system, location, error_msg='Error not available'):
try:
json_string = json.dumps(json_data, skipkeys=False, indent=4, cls=EdxJSONEncoder)
except: # pylint: disable=bare-except
json_string = repr(json_data)
return cls._construct(
system,
json.dumps(json_data, skipkeys=False, indent=4, cls=EdxJSONEncoder),
json_string,
error_msg,
location=location
)
......
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