diff --git a/src/frontend/src/index.html b/src/frontend/src/index.html index d824443..6697304 100644 --- a/src/frontend/src/index.html +++ b/src/frontend/src/index.html @@ -10,19 +10,5 @@
Loading Jarri Spooty...
- diff --git a/src/frontend/src/main.ts b/src/frontend/src/main.ts index 4a64578..dceb71b 100644 --- a/src/frontend/src/main.ts +++ b/src/frontend/src/main.ts @@ -4,11 +4,26 @@ import { appConfig } from './app/app.config'; import { AppComponent } from './app/app.component'; import { devTools } from '@ngneat/elf-devtools'; +function setBootStatus(message: string): void { + document.getElementById('boot-status')!.textContent = message; +} + +window.addEventListener('error', (event) => { + setBootStatus(`Frontend error: ${event.message || 'unknown'}`); +}); + +window.addEventListener('unhandledrejection', (event) => { + setBootStatus(`Frontend rejection: ${String(event.reason || 'unknown')}`); +}); + bootstrapApplication(AppComponent, appConfig) .then(() => { document.getElementById('boot-status')?.remove(); }) - .catch((err) => console.error(err)); + .catch((err) => { + console.error(err); + setBootStatus(`Bootstrap failed: ${String(err)}`); + }); if (isDevMode()) { devTools();