MOBILE-4470 contentlinks: Ignore errors calling getActions

main
Dani Palou 2024-05-02 11:59:13 +02:00
parent 023db99e2b
commit b26ed5a25e
2 changed files with 11 additions and 14 deletions

View File

@ -194,7 +194,10 @@ export class CoreContentLinksDelegateService {
return; 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)),
<CoreContentLinksAction[]> [],
);
if (actions && actions.length) { if (actions && actions.length) {
// Set default values if any value isn't supplied. // Set default values if any value isn't supplied.

View File

@ -47,7 +47,6 @@ export class CoreCoursesSectionLinkHandlerService extends CoreCoursesLinksHandle
url: string, url: string,
params: Record<string, string>, params: Record<string, string>,
): Promise<CoreContentLinksAction[]> { ): Promise<CoreContentLinksAction[]> {
try {
const siteId = siteIds[0] ?? false; const siteId = siteIds[0] ?? false;
const sectionId = params.id ? Number(params.id) : false; const sectionId = params.id ? Number(params.id) : false;
const siteHomeId = await CoreSites.getSiteHomeId(siteId); const siteHomeId = await CoreSites.getSiteHomeId(siteId);
@ -58,11 +57,6 @@ export class CoreCoursesSectionLinkHandlerService extends CoreCoursesLinksHandle
} }
return this.getCourseActions(url, course.id, { sectionId }); return this.getCourseActions(url, course.id, { sectionId });
} catch (error) {
this.logger.error(`Failed getting actions for url: '${url}'`, error);
return [];
}
} }
/** /**