Skip to content

Commit

Permalink
refactor: refactored code
Browse files Browse the repository at this point in the history
  • Loading branch information
eemaanamir committed Sep 19, 2024
1 parent 673b355 commit 0d11481
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
15 changes: 0 additions & 15 deletions openassessment/workflow/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,3 @@ def __init__(self, assessment_name, api_path):

class ItemNotFoundError(Exception):
"""An item was not found in the modulestore"""


class ExceptionWithContext(Exception):
"""An exception with optional context dict to be supplied in serialized result"""

def __init__(self, context=None):
super().__init__(self)
self.context = context


class XBlockInternalError(ExceptionWithContext):
"""Errors from XBlock handlers"""

def __str__(self):
return str(self.context)
6 changes: 1 addition & 5 deletions openassessment/xblock/utils/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from openedx_events.learning.data import CourseNotificationData, UserNotificationData
from django.contrib.auth import get_user_model
from openassessment.runtime_imports.functions import modulestore
from openassessment.workflow.errors import ItemNotFoundError, XBlockInternalError
from openassessment.workflow.errors import ItemNotFoundError

logger = logging.getLogger(__name__)
User = get_user_model()
Expand Down Expand Up @@ -90,7 +90,3 @@ def send_grade_assigned_notification(usage_id, ora_user_anonymized_id, score):
# Error with getting User
except User.DoesNotExist as exc:
logger.error(f'Unknown User Error: {exc}')

# Issues with the XBlock handlers
except XBlockInternalError as ex:
logger.error(ex)

0 comments on commit 0d11481

Please sign in to comment.