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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user