Currently, in MoodleBackend, if during a set_enrollment, a user must be created and this task failed, a MoodleUserCreateException is raised. This exception is not caught by the method set of the Enrollment model and it should not be manage as this is too specific exception. But currently, if this error is raised when we try to auto enroll a user during an order validation, the order validation can be rollback. That's why we have to
improve this error management and raise an EnrollmentError instead.
Purpose
Currently, in MoodleBackend, if during a
set_enrollment
, a user must be created and this task failed, a MoodleUserCreateException is raised. This exception is not caught by the methodset
of the Enrollment model and it should not be manage as this is too specific exception. But currently, if this error is raised when we try to auto enroll a user during an order validation, the order validation can be rollback. That's why we have to improve this error management and raise an EnrollmentError instead.https://gip-fun-mooc.sentry.io/issues/5141416829/?environment=preproduction&project=6599941&query=is:unresolved+issue.priority:%5Bhigh,+medium%5D&statsPeriod=90d&stream_index=7&utc=true