From 186e820b3d128230314dfdc7fb2ae5d75afda5e2 Mon Sep 17 00:00:00 2001 From: rabia23 Date: Fri, 21 Apr 2017 06:36:03 +0000 Subject: [PATCH] update log when there's an IndexError on loading courseware raise IndexError after catching it --- lms/djangoapps/courseware/views/index.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lms/djangoapps/courseware/views/index.py b/lms/djangoapps/courseware/views/index.py index 7de2fcc051..832725752b 100644 --- a/lms/djangoapps/courseware/views/index.py +++ b/lms/djangoapps/courseware/views/index.py @@ -392,11 +392,16 @@ class CoursewareIndex(View): courseware_context['sequence_title'] = display_items[self.section.position - 1] \ .display_name_with_default except IndexError: - log.info("Course section {} with position {} and total section display items: {}".format( + log.exception( + "IndexError loading courseware for user %s, course %s, section %s, position %d. Total items: %d. URL: %s", + self.real_user.username, + self.course.id, self.section.display_name_with_default, self.section.position, len(display_items), - )) + self.url, + ) + raise return courseware_context def _add_entrance_exam_to_context(self, courseware_context):