openfun / joanie

👛 A headless ERP for education to manage course enrollment/subscription, payment and certificates delivery.
MIT License
22 stars 2 forks source link

🐛(backend) prevent automatic enrollment failure to raise error #848

Closed jbpenrath closed 3 months ago

jbpenrath commented 3 months ago

Purpose

On order validation, the enroll_user_to_course_run is triggered and sometimes this one can raise exception. In atomic transition context, this is weird as it causes the rollback of database changes and from api point of view the endpoint returns an internal server error... As this method can be considered of a side effect it should impact nothing if it fails. In order to fix that, we catch all exception raised by this method and just send an error log to Sentry.