Faro & grafana improvements
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import App from './App';
|
||||
import ErrorBoundary from './components/ErrorBoundary';
|
||||
import './index.css';
|
||||
import { initNativeShell } from './utils/native';
|
||||
import { initFaro } from './utils/faro';
|
||||
@@ -9,9 +10,19 @@ import { initFaro } from './utils/faro';
|
||||
// No-op if VITE_FARO_ENDPOINT is not configured.
|
||||
initFaro();
|
||||
|
||||
// Global unhandled promise rejection handler — report to Faro
|
||||
window.addEventListener('unhandledrejection', (event) => {
|
||||
console.warn('[unhandledrejection]', event.reason);
|
||||
try {
|
||||
window.__faro?.api?.pushError(event.reason, { type: 'unhandled-rejection' });
|
||||
} catch { /* Faro must never break the app */ }
|
||||
});
|
||||
|
||||
ReactDOM.createRoot(document.getElementById('root')).render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
<ErrorBoundary>
|
||||
<App />
|
||||
</ErrorBoundary>
|
||||
</React.StrictMode>
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user