diff --git a/src/core/features/contentlinks/services/contentlinks-delegate.ts b/src/core/features/contentlinks/services/contentlinks-delegate.ts index fdad022f5..0c2fa6e22 100644 --- a/src/core/features/contentlinks/services/contentlinks-delegate.ts +++ b/src/core/features/contentlinks/services/contentlinks-delegate.ts @@ -194,7 +194,10 @@ export class CoreContentLinksDelegateService { return; } - const actions = await handler.getActions(siteIds, relativeUrl, params, courseId, data); + const actions = await CoreUtils.ignoreErrors( + Promise.resolve(handler.getActions(siteIds, relativeUrl, params, courseId, data)), + [], + ); if (actions && actions.length) { // Set default values if any value isn't supplied. diff --git a/src/core/features/courses/services/handlers/section-link.ts b/src/core/features/courses/services/handlers/section-link.ts index 8efa10b0d..4a86ffe1a 100644 --- a/src/core/features/courses/services/handlers/section-link.ts +++ b/src/core/features/courses/services/handlers/section-link.ts @@ -47,22 +47,16 @@ export class CoreCoursesSectionLinkHandlerService extends CoreCoursesLinksHandle url: string, params: Record, ): Promise { - try { - const siteId = siteIds[0] ?? false; - const sectionId = params.id ? Number(params.id) : false; - const siteHomeId = await CoreSites.getSiteHomeId(siteId); - const course = await this.getSectionCourse(sectionId, siteId); - - if (!sectionId || !course || course.id === siteHomeId) { - return []; - } - - return this.getCourseActions(url, course.id, { sectionId }); - } catch (error) { - this.logger.error(`Failed getting actions for url: '${url}'`, error); + const siteId = siteIds[0] ?? false; + const sectionId = params.id ? Number(params.id) : false; + const siteHomeId = await CoreSites.getSiteHomeId(siteId); + const course = await this.getSectionCourse(sectionId, siteId); + if (!sectionId || !course || course.id === siteHomeId) { return []; } + + return this.getCourseActions(url, course.id, { sectionId }); } /**