From 0060de1459b4664e82b3b0e9198e56b68012ccbe Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Fri, 11 Feb 2022 10:06:51 +0100 Subject: [PATCH] MOBILE-3833 grades: Ignore notingroup error in prefetch --- .../grades/services/handlers/course-option.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/core/features/grades/services/handlers/course-option.ts b/src/core/features/grades/services/handlers/course-option.ts index 21fb0053b..7c9049339 100644 --- a/src/core/features/grades/services/handlers/course-option.ts +++ b/src/core/features/grades/services/handlers/course-option.ts @@ -100,7 +100,16 @@ export class CoreGradesCourseOptionHandlerService implements CoreCourseOptionsHa * @return Promise resolved when done. */ async prefetch(course: CoreEnrolledCourseDataWithExtraInfoAndOptions): Promise { - await CoreGrades.getCourseGradesTable(course.id, undefined, undefined, true); + try { + await CoreGrades.getCourseGradesTable(course.id, undefined, undefined, true); + } catch (error) { + if (error.errorcode === 'notingroup') { + // Don't fail the download because of this error. + return; + } + + throw error; + } } }