Mixins#
DRF view mixins implementing the Open edX REST API conventions, currently
StandardizedErrorMixin — the per-view opt-in for the ADR 0029
standardized error-response handler.
- class StandardizedErrorMixin#
Opt-in mixin that routes DRF exceptions on this view through the ADR 0029 standardized error-response handler (
edx_rest_framework_extensions.errors.standardized_error_exception_handler()).DRF’s
rest_framework.views.APIViewcallsself.get_exception_handlerinsidehandle_exception; overriding that method here lets the view return the standardized envelope while other endpoints continue to use whichever handler the project-wideEXCEPTION_HANDLERsetting points at.Usage:
class MyViewSet(StandardizedErrorMixin, viewsets.ViewSet): ...