MDL-69704 course: catch exception when calling get_course_content_items