refactor: move xmodule folder to root

- Moving xmodule folder to root as we're dissolving sub-projects of common folder in edx-platform
    - More info: https://openedx.atlassian.net/browse/BOM-2579
- -e common/lib/xmodule has been removed from the requirements as xmodule has itself become the part of edx-platform and not being installed through requirements
- The test files common/lib/xmodule/test_files/ have been removed as they are not being used anymore
This commit is contained in:
M Umar Khan
2022-05-19 21:40:48 +05:00
parent 26c8ec5c2a
commit a91df0c40f
487 changed files with 216 additions and 339 deletions

54
xmodule/exceptions.py Normal file
View File

@@ -0,0 +1,54 @@
# lint-amnesty, pylint: disable=missing-module-docstring
class InvalidDefinitionError(Exception):
pass
class NotFoundError(Exception):
pass
class ProcessingError(Exception):
'''
An error occurred while processing a request to the XModule.
For example: if an exception occurs while checking a capa problem.
'''
pass # lint-amnesty, pylint: disable=unnecessary-pass
class InvalidVersionError(Exception):
"""
Tried to save an item with a location that a store cannot support (e.g., draft version
for a non-leaf node)
"""
def __init__(self, location):
super().__init__()
self.location = location
class SerializationError(Exception):
"""
Thrown when a module cannot be exported to XML
"""
def __init__(self, location, msg):
super().__init__(msg)
self.location = location
class UndefinedContext(Exception):
"""
Tried to access an xmodule field which needs a different context (runtime) to have a value.
"""
pass # lint-amnesty, pylint: disable=unnecessary-pass
class HeartbeatFailure(Exception):
"""
Raised when heartbeat fails.
"""
def __init__(self, msg, service):
"""
In addition to a msg, provide the name of the service.
"""
self.service = service
super().__init__(msg)