MOBILE-4470 contentlinks: Ignore errors calling getActions
parent
023db99e2b
commit
b26ed5a25e
|
@ -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)),
|
||||
<CoreContentLinksAction[]> [],
|
||||
);
|
||||
|
||||
if (actions && actions.length) {
|
||||
// Set default values if any value isn't supplied.
|
||||
|
|
|
@ -47,22 +47,16 @@ export class CoreCoursesSectionLinkHandlerService extends CoreCoursesLinksHandle
|
|||
url: string,
|
||||
params: Record<string, string>,
|
||||
): Promise<CoreContentLinksAction[]> {
|
||||
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 });
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue