[frontend] Prevent "uncaught in promise" exceptions from being logged in the console
import $ from 'jquery';
import * as ko from 'knockout';
+import { ASSIST_KEY_COMPONENT } from './assist/ko.assistKey';
import componentUtils from './componentUtils';
import huePubSub from 'utils/huePubSub';
+import { noop } from 'utils/hueUtils';
import I18n from 'utils/i18n';
-import { ASSIST_KEY_COMPONENT } from './assist/ko.assistKey';
-
export const NAME = 'catalog-entries-list';
// prettier-ignore
@@ -465,7 +465,8 @@ class CatalogEntriesList {
const joinsPromise = self
.catalogEntry()
.getTopJoins({ silenceErrors: true, cancellable: true });
- joinsPromise.then(topJoins => {
+ joinsPromise
+ .then(topJoins => {
if (topJoins && topJoins.values && topJoins.values.length) {
entriesAddedDeferred.then(entries => {
const entriesIndex = {};
@@ -499,7 +500,8 @@ class CatalogEntriesList {
});
});
}
- });
+ })
+ .catch(noop);
self.cancellablePromises.push(joinsPromise);
}
@@ -519,7 +521,8 @@ class CatalogEntriesList {
.loadOptimizerPopularityForChildren({ silenceErrors: true, cancellable: true })
.then(popularEntries => {
if (popularEntries.length) {
- childPromise.then(() => {
+ childPromise
+ .then(() => {
const entryIndex = {};
self.entries().forEach(entry => {
entryIndex[entry.catalogEntry().name] = entry;
@@ -552,9 +555,11 @@ class CatalogEntriesList {
if (foundPopularEntries) {
self.entries().sort(entrySort);
}
- });
+ })
+ .catch(noop);
}
})
+ .catch(noop)
);
if (self.catalogEntry().isTableOrView() || self.catalogEntry().isComplex()) {
@@ -596,6 +601,7 @@ class CatalogEntriesList {
}
}
})
+ .catch(noop)
.finally(() => {
self.loadingSamples(false);
firstSampleFetch = false;
