MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / initDesktopCrashReporting

Function initDesktopCrashReporting

packages/app/src/crash-reporting.ts:26–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24}
25
26export const initDesktopCrashReporting = (): void => {
27 if (typeof window === "undefined") return;
28 const bridge = (window as Window & { readonly executor?: CrashReportingBridge }).executor;
29 if (typeof bridge?.getCrashReporting !== "function") return;
30 const init = async () => {
31 // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: crash reporting must never take the app down with it
32 try {
33 const config = await bridge.getCrashReporting?.();
34 if (!config?.dsn) return;
35 const Sentry = await import("@sentry/browser");
36 Sentry.init({
37 dsn: config.dsn,
38 release: config.release,
39 environment: config.environment,
40 sendDefaultPii: false,
41 tracesSampleRate: 0,
42 initialScope: {
43 tags: {
44 process: "renderer",
45 runId: config.runId,
46 },
47 },
48 });
49 } catch {
50 // Reporting failures stay silent — there is nowhere left to report them.
51 }
52 };
53 void init();
54};

Callers 1

entry-client.tsxFile · 0.90

Calls 1

initFunction · 0.70

Tested by

no test coverage detected