MOBILE-3068 core: Fix some uncaught promises

main
Pau Ferrer Ocaña 2019-08-22 17:15:33 +02:00
parent cb9b936b3c
commit 51403efcca
3 changed files with 7 additions and 1 deletions

View File

@ -96,7 +96,9 @@ export class CoreCourseModule {
eventsProvider.on(CoreEventsProvider.LOGIN, () => {
// Log the app is open to keep user in online status.
setTimeout(() => {
cronDelegate.forceCronHandlerExecution(logHandler.name);
cronDelegate.forceCronHandlerExecution(logHandler.name).catch((e) => {
// Ignore errors here, since probably login is not complete: it happens on token invalid.
});
}, 1000);
});
}

View File

@ -114,6 +114,8 @@ export class CoreSitePluginsHelperProvider {
eventsProvider.trigger(CoreEventsProvider.SITE_PLUGINS_LOADED, {}, data.siteId);
});
}
}).catch((e) => {
// Ignore errors here.
}).finally(() => {
this.sitePluginsProvider.setPluginsFetched();
});

View File

@ -1385,6 +1385,8 @@ export class CoreSitesProvider {
this.eventsProvider.trigger(CoreEventsProvider.SITE_UPDATED, info, siteId);
});
});
}).catch((error) => {
// Ignore that we cannot fetch site info. Probably the auth token is invalid.
});
});
}