Merge pull request #31380 from openedx/ashultz0/more-goal-email-info

fix: wrap course goals email handle to report on errors
This commit is contained in:
Andrew Shultz
2022-11-30 16:06:36 -05:00
committed by GitHub

View File

@@ -112,7 +112,21 @@ class Command(BaseCommand):
def handle(self, *args, **options):
"""
Docstring
Handle goal emails across all courses.
This outer layer calls the inner and reports on any exception that
occurred.
"""
try:
self._handle_all_goals()
except Exception: # pylint: disable=broad-except
log.exception("Error while sending course goals emails: ")
raise
def _handle_all_goals(self):
"""
Handle goal emails across all courses
Helpful notes for the function:
weekday() returns an int 0-6 with Monday being 0 and Sunday being 6