MOBILE-3833 grades: Ignore notingroup error in prefetch

main
Dani Palou 2022-02-11 10:06:51 +01:00
parent 81269498bd
commit 0060de1459
1 changed files with 10 additions and 1 deletions

View File

@ -100,7 +100,16 @@ export class CoreGradesCourseOptionHandlerService implements CoreCourseOptionsHa
* @return Promise resolved when done.
*/
async prefetch(course: CoreEnrolledCourseDataWithExtraInfoAndOptions): Promise<void> {
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;
}
}
}