MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / reportError

Function reportError

src/services/log-report.ts:28–39  ·  view source on GitHub ↗
(message: string, stack?: string)

Source from the content-addressed store, hash-verified

26}
27
28export function reportError(message: string, stack?: string): void {
29 if (!message) return
30 const key = `${message}::${stack?.split('\n')[1] ?? ''}`
31 if (!shouldReport(key)) return
32 // Fire-and-forget; never let reporting throw or block the UI.
33 void post('/logs/report', {
34 level: 'error',
35 message,
36 stack,
37 url: typeof location !== 'undefined' ? location.href : undefined,
38 }).catch(() => {})
39}
40
41/** Install global handlers. Call once at app startup. */
42export function installGlobalErrorReporting(): void {

Callers 2

main.tsFile · 0.90

Calls 2

postFunction · 0.90
shouldReportFunction · 0.85

Tested by

no test coverage detected