Log promise failures instead of ignoring them (#531)

In case the failure does not get handled, it should at least get logged, to prevent silently ignoring it
This commit is contained in:
schroda
2023-12-31 01:42:54 +01:00
committed by GitHub
parent 37d6b84cf4
commit 37ce494fda
10 changed files with 44 additions and 13 deletions

View File

@@ -25,6 +25,7 @@ import { LoadingPlaceholder } from '@/components/util/LoadingPlaceholder';
import { GetAboutQuery, UpdateState } from '@/lib/graphql/generated/graphql.ts';
import { ABOUT_WEBUI, WEBUI_UPDATE_CHECK } from '@/lib/graphql/Fragments.ts';
import { makeToast } from '@/components/util/Toast.tsx';
import { defaultPromiseErrorHandler } from '@/util/defaultPromiseErrorHandler.ts';
type AboutServer = GetAboutQuery['aboutServer'];
@@ -224,7 +225,9 @@ export function About() {
const resetUpdateStatus = isError || updateFinished;
if (resetUpdateStatus) {
requestManager.resetWebUIUpdateStatus().response.catch(() => {});
requestManager
.resetWebUIUpdateStatus()
.response.catch(defaultPromiseErrorHandler('About::resetWebUIUpdateStatus'));
}
if (!updateFinished) {
@@ -326,7 +329,11 @@ export function About() {
isUpdateAvailable={isWebUIUpdateAvailable}
updateCheckError={webUIUpdateCheckError}
checkForUpdate={checkForWebUIUpdate}
triggerUpdate={() => requestManager.updateWebUI().response.catch(() => {})}
triggerUpdate={() =>
requestManager
.updateWebUI()
.response.catch(defaultPromiseErrorHandler('About::updateWebUI'))
}
progress={webUIUpdateProgress}
updateState={webUIUpdateState}
/>