MCPcopy Create free account
hub / github.com/GCWing/BitFun / scheduleCrashLog

Function scheduleCrashLog

src/web-ui/src/main.tsx:90–113  ·  view source on GitHub ↗
(payload: { location: string; message: string; data?: Record<string, unknown> })

Source from the content-addressed store, hash-verified

88 w[flag] = true;
89
90 const scheduleCrashLog = (payload: { location: string; message: string; data?: Record<string, unknown> }) => {
91 // Always persist uncaught errors so they appear in webview.log for diagnostics.
92 // Mark white-screen crashes separately to allow callers to deduplicate.
93 queueMicrotask(() => {
94 requestAnimationFrame(() => {
95 requestAnimationFrame(() => {
96 const isWhiteScreen = isRootEmpty();
97 const crashType = isWhiteScreen ? 'white-screen' : 'page-error';
98 // Deduplicate only white-screen crashes to avoid duplicate startup logs.
99 if (isWhiteScreen && hasLoggedWhiteScreenCrash()) {
100 return;
101 }
102 if (isWhiteScreen) {
103 markWhiteScreenCrashLogged();
104 }
105 log.error(`[CRASH:${crashType}] Uncaught error`, {
106 location: payload.location,
107 message: payload.message,
108 ...payload.data,
109 });
110 });
111 });
112 });
113 };
114
115 window.addEventListener(
116 'error',

Callers 1

Calls 4

isRootEmptyFunction · 0.85
errorMethod · 0.45

Tested by

no test coverage detected