Repository navigation
Return a specific error code in the API error for compliance check failure - #3938
Merged
Merged
Conversation
OpenAPI ChangesShow/hide changesUnexpected changes? Ensure your branch is up-to-date with |
rhysyngsun
marked this pull request as ready for review
September 14, 2026 18:19
pdpinch
reviewed
Sep 14, 2026
rhysyngsun
force-pushed
the
nl/export-compliance-error-code
branch
from
September 14, 2026 19:02
ab10f71 to
4066118
Compare
cp-at-mit
approved these changes
Sep 15, 2026
rhysyngsun
force-pushed
the
nl/export-compliance-error-code
branch
3 times, most recently
from
September 22, 2026 20:20
4bf833a to
a6c9d8e
Compare
rhysyngsun
added this pull request to stack #4021
September 24, 2026 13:40
rhysyngsun
force-pushed
the
nl/export-compliance-error-code
branch
from
September 24, 2026 15:22
a6c9d8e to
7d30455
Compare
rhysyngsun
force-pushed
the
nl/export-compliance-error-code
branch
4 times, most recently
from
October 5, 2026 14:30
8a6b41c to
a2e63ef
Compare
cp-at-mit
approved these changes
Oct 6, 2026
An enrollment blocked by a CyberSource export compliance rejection returned the same opaque 400 detail as every other enrollment failure, so a learner contacting support had nothing to quote and no way to know retrying could not help. ExportComplianceError now declares error_code = "CS_700", and EnrollmentError.from_cause appends it to the detail. Causes that declare no code — including ExportComplianceDataError, which never reached CyberSource and so has no CyberSource code — keep the detail unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
rhysyngsun
force-pushed
the
nl/export-compliance-error-code
branch
from
October 6, 2026 19:02
a2e63ef to
f228f84
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What are the relevant tickets?
https://github.com/mitodl/hq/issues/13250
Description (What does it do?)
An enrollment blocked by a CyberSource export compliance rejection returned the same opaque detail as every other enrollment failure, so a learner contacting support had nothing to quote — and no way to know that retrying could not work.
ExportComplianceErrornow declareserror_code = "CS_700".EnrollmentError.from_cause(exc)appends it, giving"Unable to complete enrollment. Error code: CS_700".How can this be tested?
Tests should pass, this can be functionally testing with the work in mitodl/mit-learn#3918