Files
edx-platform/xmodule/capa/errors.py
gabrielC1409 db27ab6166 feat: Send xqueue submissions to edx-submission
fix: Restructuring to send course_id and score to edx submission

fix: Refactoring of sending information to sent_to_submission

fix: Elimination of unnecessary functions

fix: Added usage comment to ProblemBlock in XqueueInterface constructor

fix: update doc ADR

fix: setting for Quality Others test (ubuntu-24.04, 3.11, 20)

fix: Deprecation for django-trans-escape-filter-parse-error

test: Add @pytest.mark.django_db decorator to test functions

test: Fix for pylint being disabled

fix: updated changes for pylint disable

fix: update error from docs ADR-0005

update: xmodule/docs/decisions/0005-send-data-to-edx-submission.rst

Co-authored-by: Sarina Canelake <sarina@axim.org>

update: xmodule/docs/decisions/0005-send-data-to-edx-submission.rst

Co-authored-by: Sarina Canelake <sarina@axim.org>

fix: Adjusted correction

fix: update date for docs ADR

Revert "fix: update date for docs ADR"

This reverts commit 0b4229c51c4937f95cb407872645dd448df45418.

fix: replace call created_submission to create_external_grader_detail

fix: update test xqueue_submission

fix: add docstring in test_xqueue_submission

fix: update date doc ADR

fix: update version edx-submission 3.8.6

fix: add @pytest.mark.xfail

fix: add 20 chances in test_capa_block:

fix: increase retry attempts for seed generation in ProblemBlockTest

fix: change version to edx-submission lib

fix: new version edx-submission in testings

fix: replace parameter file to files

fix: update variable grader_file_name and points_possible

fix: Adjustment in the is_flag_active function to always take the last record edited in the waffle

fix: wrap large line of code

fix: update function is_flag_active

fix: code style adjustment

fix: changes for 60 retry

feat: use CourseWaffleFlag to determine xqueue callback path

fix: Code style adjustment

fix: remove deprecated xqueue callback route and simplify callback type logic

fix: Deleting a comment in the ADR document

fix: add log in self.block is None

fix: Code style adjustment in log
2025-04-15 11:59:32 -04:00

57 lines
1.6 KiB
Python

# errors.py
"""
Custom error handling for the XQueue submission interface.
"""
class XQueueSubmissionError(Exception):
"""Base class for all XQueue submission errors."""
class JSONParsingError(XQueueSubmissionError):
"""Raised when JSON parsing fails."""
MESSAGE = "Error parsing {name}: {error}"
def __init__(self, name, error):
super().__init__(self.MESSAGE.format(name=name, error=error))
class MissingKeyError(XQueueSubmissionError):
"""Raised when a required key is missing."""
MESSAGE = "Missing key: {key}"
def __init__(self, key):
super().__init__(self.MESSAGE.format(key=key))
class ValidationError(XQueueSubmissionError):
"""Raised when a validation check fails."""
MESSAGE = "Validation error: {error}"
def __init__(self, error):
super().__init__(self.MESSAGE.format(error=error))
class TypeErrorSubmission(XQueueSubmissionError):
"""Raised when an invalid type is encountered."""
MESSAGE = "Type error: {error}"
def __init__(self, error):
super().__init__(self.MESSAGE.format(error=error))
class RuntimeErrorSubmission(XQueueSubmissionError):
"""Raised for runtime errors."""
MESSAGE = "Runtime error: {error}"
def __init__(self, error):
super().__init__(self.MESSAGE.format(error=error))
class GetSubmissionParamsError(XQueueSubmissionError):
"""Raised when there is an issue getting submission parameters."""
MESSAGE = "Submission parameters error: {error}"
def __init__(self, error="Block instance is not defined!"):
super().__init__(self.MESSAGE.format(error=error))