feat: add alert when critical errors prevent an app launch

This commit is contained in:
2023-10-20 13:26:01 +02:00
committed by Rainer Killinger
parent 066e374462
commit 61587c7ba1
3 changed files with 60 additions and 52 deletions

View File

@@ -68,6 +68,8 @@ import {browserFactory, SimpleBrowser} from './util/browser.factory';
import {getDateFnsLocale} from './translation/dfns-locale';
import {setDefaultOptions} from 'date-fns';
import {DateFnsConfigurationService} from 'ngx-date-fns';
import {Capacitor} from '@capacitor/core';
import {SplashScreen} from '@capacitor/splash-screen';
registerLocaleData(localeDe);
@@ -88,6 +90,7 @@ export function initializerFactory(
dateFnsConfigurationService: DateFnsConfigurationService,
) {
return async () => {
try {
initLogger(logger);
await storageProvider.init();
await configProvider.init();
@@ -115,6 +118,12 @@ export function initializerFactory(
} catch (error) {
logger.warn(error);
}
} catch (error) {
if (Capacitor.isNativePlatform()) {
await SplashScreen.hide();
}
alert(`Critical error: ${error}`);
}
};
}

View File

@@ -36,8 +36,8 @@
"glob": "10.2.7",
"junit-report-merger": "6.0.2",
"syncpack": "10.5.1",
"turbo": "1.10.3",
"turbo-ignore": "1.10.6",
"turbo": "1.10.16",
"turbo-ignore": "1.10.16",
"typedoc": "0.24.8",
"typescript": "5.1.6"
}

53
pnpm-lock.yaml generated
View File

@@ -33,11 +33,11 @@ importers:
specifier: 10.5.1
version: 10.5.1
turbo:
specifier: 1.10.3
version: 1.10.3
specifier: 1.10.16
version: 1.10.16
turbo-ignore:
specifier: 1.10.6
version: 1.10.6
specifier: 1.10.16
version: 1.10.16
typedoc:
specifier: 0.24.8
version: 0.24.8(typescript@5.1.6)
@@ -18717,70 +18717,69 @@ packages:
safe-buffer: 5.2.1
dev: true
/turbo-darwin-64@1.10.3:
resolution: {integrity: sha512-IIB9IomJGyD3EdpSscm7Ip1xVWtYb7D0x7oH3vad3gjFcjHJzDz9xZ/iw/qItFEW+wGFcLSRPd+1BNnuLM8AsA==}
/turbo-darwin-64@1.10.16:
resolution: {integrity: sha512-+Jk91FNcp9e9NCLYlvDDlp2HwEDp14F9N42IoW3dmHI5ZkGSXzalbhVcrx3DOox3QfiNUHxzWg4d7CnVNCuuMg==}
cpu: [x64]
os: [darwin]
requiresBuild: true
dev: true
optional: true
/turbo-darwin-arm64@1.10.3:
resolution: {integrity: sha512-SBNmOZU9YEB0eyNIxeeQ+Wi0Ufd+nprEVp41rgUSRXEIpXjsDjyBnKnF+sQQj3+FLb4yyi/yZQckB+55qXWEsw==}
/turbo-darwin-arm64@1.10.16:
resolution: {integrity: sha512-jqGpFZipIivkRp/i+jnL8npX0VssE6IAVNKtu573LXtssZdV/S+fRGYA16tI46xJGxSAivrZ/IcgZrV6Jk80bw==}
cpu: [arm64]
os: [darwin]
requiresBuild: true
dev: true
optional: true
/turbo-ignore@1.10.6:
resolution: {integrity: sha512-LVWRJU1p1+8rON1f8fweLrFUo0kOex+r3BD5NlxYdUuXpRzcC1SMgu3RSULJRZhRErNs5XwzcIuXWSQn1TySHg==}
/turbo-ignore@1.10.16:
resolution: {integrity: sha512-Xm2/pnXsunH2UQ3S92hQwRKiANNgXUhv2owqCFOmqwl3G2E+0yM2lSk+QLNYUu4XUqXkJrDv32GtZTDaPJ47vA==}
hasBin: true
dev: true
/turbo-linux-64@1.10.3:
resolution: {integrity: sha512-kvAisGKE7xHJdyMxZLvg53zvHxjqPK1UVj4757PQqtx9dnjYHSc8epmivE6niPgDHon5YqImzArCjVZJYpIGHQ==}
/turbo-linux-64@1.10.16:
resolution: {integrity: sha512-PpqEZHwLoizQ6sTUvmImcRmACyRk9EWLXGlqceogPZsJ1jTRK3sfcF9fC2W56zkSIzuLEP07k5kl+ZxJd8JMcg==}
cpu: [x64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/turbo-linux-arm64@1.10.3:
resolution: {integrity: sha512-Qgaqln0IYRgyL0SowJOi+PNxejv1I2xhzXOI+D+z4YHbgSx87ox1IsALYBlK8VRVYY8VCXl+PN12r1ioV09j7A==}
/turbo-linux-arm64@1.10.16:
resolution: {integrity: sha512-TMjFYz8to1QE0fKVXCIvG/4giyfnmqcQIwjdNfJvKjBxn22PpbjeuFuQ5kNXshUTRaTJihFbuuCcb5OYFNx4uw==}
cpu: [arm64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/turbo-windows-64@1.10.3:
resolution: {integrity: sha512-rbH9wManURNN8mBnN/ZdkpUuTvyVVEMiUwFUX4GVE5qmV15iHtZfDLUSGGCP2UFBazHcpNHG1OJzgc55GFFrUw==}
/turbo-windows-64@1.10.16:
resolution: {integrity: sha512-+jsf68krs0N66FfC4/zZvioUap/Tq3sPFumnMV+EBo8jFdqs4yehd6+MxIwYTjSQLIcpH8KoNMB0gQYhJRLZzw==}
cpu: [x64]
os: [win32]
requiresBuild: true
dev: true
optional: true
/turbo-windows-arm64@1.10.3:
resolution: {integrity: sha512-ThlkqxhcGZX39CaTjsHqJnqVe+WImjX13pmjnpChz6q5HHbeRxaJSFzgrHIOt0sUUVx90W/WrNRyoIt/aafniw==}
/turbo-windows-arm64@1.10.16:
resolution: {integrity: sha512-sKm3hcMM1bl0B3PLG4ifidicOGfoJmOEacM5JtgBkYM48ncMHjkHfFY7HrJHZHUnXM4l05RQTpLFoOl/uIo2HQ==}
cpu: [arm64]
os: [win32]
requiresBuild: true
dev: true
optional: true
/turbo@1.10.3:
resolution: {integrity: sha512-U4gKCWcKgLcCjQd4Pl8KJdfEKumpyWbzRu75A6FCj6Ctea1PIm58W6Ltw1QXKqHrl2pF9e1raAskf/h6dlrPCA==}
/turbo@1.10.16:
resolution: {integrity: sha512-2CEaK4FIuSZiP83iFa9GqMTQhroW2QryckVqUydmg4tx78baftTOS0O+oDAhvo9r9Nit4xUEtC1RAHoqs6ZEtg==}
hasBin: true
requiresBuild: true
optionalDependencies:
turbo-darwin-64: 1.10.3
turbo-darwin-arm64: 1.10.3
turbo-linux-64: 1.10.3
turbo-linux-arm64: 1.10.3
turbo-windows-64: 1.10.3
turbo-windows-arm64: 1.10.3
turbo-darwin-64: 1.10.16
turbo-darwin-arm64: 1.10.16
turbo-linux-64: 1.10.16
turbo-linux-arm64: 1.10.16
turbo-windows-64: 1.10.16
turbo-windows-arm64: 1.10.16
dev: true
/tweetnacl@0.14.5: