Skip to content

feat: return detailed error from proctoring provider - #38925

Open
Anas12091101 wants to merge 2 commits into
openedx:masterfrom
mitodl:anas/return-detail-proctoring-error
Open

feat: return detailed error from proctoring provider#38925
Anas12091101 wants to merge 2 commits into
openedx:masterfrom
mitodl:anas/return-detail-proctoring-error

Conversation

@Anas12091101

@Anas12091101 Anas12091101 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Description

Resetting a proctored exam attempt from the new instructor dashboard previously failed with a generic 500 when the proctoring provider was slow/unavailable, leaving the attempt "stuck" with no explanation.

This PR updates the Instructor v2 reset endpoint (SpecialExamResetView in lms/djangoapps/instructor/views/api_v2.py) to catch ProctoredBaseException from remove_exam_attempt and return the exception's own status + message:

except ProctoredBaseException as err:
    return Response({'detail': str(err)}, status=err.http_status)

Now a provider failure returns a 502 with a clear detail (e.g. "The proctoring provider is temporarily unavailable… please try again in a few minutes."), which the instructor-dashboard MFE already displays. Same pattern as the existing ProctoredBaseException handling in this file.

Impacted roles: Instructor/Course Staff (clear error instead of a 500), Operator (failure is now logged/typed).

Supporting information

  • Bug: instructor dashboard "reset exam attempt error" (reset 500s, attempt remains) with the Proctortrack provider.
  • Depends on openedx/edx-proctoring#1337, which raises the typed BackendProviderCannotRemoveAttempt (502) this view relies on.
  • Screenshot
Screenshot 2026-07-28 at 1 15 00 PM

Testing instructions

Automated:

pytest lms/djangoapps/instructor/tests/views/test_special_exams_api_v2.py::SpecialExamResetViewTest

Manual (needs edx-proctoring >= 6.1.0):

  1. Create a proctored exam (REST backend) and have a learner start an attempt.
  2. Make the provider fail — point the backend base_url at an unreachable host (or stub remove_exam_attempt to raise).
  3. As instructor, reset the attempt (dashboard → Special Exams → Exam Attempts).
  4. Expect: 502 with {"detail": "…temporarily unavailable…"}, the message shown in the UI, attempt still present, error logged.
  5. Regression: with a healthy provider, reset still returns 200 and removes the attempt.

Deadline

None, though it fixes a production-visible bug.

Other information

@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @Anas12091101!

This repository is currently maintained by @openedx/wg-maintenance-openedx-platform.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jul 27, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in Contributions Jul 27, 2026
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Status: Waiting on Author

Development

Successfully merging this pull request may close these issues.

3 participants