MCPcopy Create free account
hub / github.com/ecto/muni / capture

Method capture

depot/console/src/lib/errorTracking.ts:53–73  ·  view source on GitHub ↗
(error: Error, context?: Record<string, unknown>)

Source from the content-addressed store, hash-verified

51 }
52
53 capture(error: Error, context?: Record<string, unknown>) {
54 const event: ErrorEvent = {
55 message: error.message,
56 stack: error.stack,
57 context,
58 timestamp: new Date().toISOString(),
59 sessionId: this.sessionId,
60 url: window.location.href,
61 userAgent: navigator.userAgent,
62 };
63
64 this.buffer.push(event);
65
66 // Also log to console for dev visibility
67 console.error("[ErrorTracker]", error.message, context);
68
69 // Flush if buffer exceeds threshold
70 if (this.buffer.length >= 10) {
71 this.flush();
72 }
73 }
74
75 getSessionId(): string {
76 return this.sessionId;

Callers 4

setupGlobalHandlersMethod · 0.95
componentDidCatchMethod · 0.80
useDiscoveryFunction · 0.80
useRoverConnectionRtcFunction · 0.80

Calls 2

flushMethod · 0.95
pushMethod · 0.45

Tested by

no test coverage detected