fix: wrap course goals email handle to report on errors

currently this is failing many runs but the exception information is
lost at some higher level. Report on it immediately.
This commit is contained in:
Andy Shultz
2022-11-30 10:52:17 -05:00
parent 929d4b97d2
commit 5ff9b73da3

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