MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / installGlobalErrorReporting

Function installGlobalErrorReporting

src/services/log-report.ts:42–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40
41/** Install global handlers. Call once at app startup. */
42export function installGlobalErrorReporting(): void {
43 window.addEventListener('error', (e) => {
44 reportError(e.message || String(e.error), e.error?.stack)
45 })
46 window.addEventListener('unhandledrejection', (e) => {
47 const reason = e.reason
48 reportError(
49 reason instanceof Error ? reason.message : `Unhandled rejection: ${String(reason)}`,
50 reason instanceof Error ? reason.stack : undefined
51 )
52 })
53}

Callers 1

main.tsFile · 0.90

Calls 1

reportErrorFunction · 0.85

Tested by

no test coverage detected